OpenResty

love at first sight

under the moon

OpenResty (aka. ngx_openresty) is a full-fledged web application server by bundling the standard Nginx core, lots of 3rd-party Nginx modules, as well as most of their external dependencies.




http://openresty.org/#Components

Yet another damn fork?

OpenResty is not an Nginx fork. It is just a software bundle. Most of the patches applied to the Nginx core in OpenResty have already been submitted to the official Nginx team and most of the patches submitted have also been accepted. We are trying hard not to fork Nginx and always to use the latest best Nginx core from the official Nginx team.

Hello, World!

worker_processes  1;
error_log logs/error.log;
events {
    worker_connections 1024;
}
http {
    server {
        listen 8080;
        location / {
            default_type text/html;
            content_by_lua '
                ngx.say("<p>hello, world</p>")
            ';
        }
    }
}

What are people doing with it?

  • Nginx image processing server with OpenResty and Lua;
  • WebSockets with OpenResty;
  • Adding OAuth Support to Nginx via Lua;
  • My beautiful dark twisted reverse-proxy LRU cache;
  • [...] .



http://openresty.org/#Resources

What are we doing with it?

  • Serving JSON from backend as JSONP (MIP);
  • Wrapping elasticsearch for autocompletion (appsfuel);
  • API authentication using DNFW session cookie (appsfuel);
  • Shorturl API (appsfuel).

Performance?

http://www.techempower.com/benchmarks/

Who's using it?

OpenResty

By Giorgio Salluzzo