Quick Start

Add following configuration to some location context in nginx.conf and start Nginx.

server {
    listen      8000;
    server_name localhost;
    location /mruby {
        mruby_content_handler_code "
            r = Nginx::Request.new
            r.content_type = 'text/plain'
            Nginx.rputs('Hello, World!\n')
        ";
    }
}

The response from this location to the request is following.

$ curl "http://localhost:8000/mruby" 
Hello, World!
$