The lua-nginx-module embeds the Lua interpreter or LuaJIT 2 into the nginx core and integrates the powerful Lua threads (aka Lua coroutines) into the Nginx event model by means of cosockets and Nginx subrequests.
Unlike Apache's mod_lua and Lighttpd's mod_magnet, Lua code executed using this module can be 100% non-blocking on network traffic as long as the Nginx API for Lua provided by this module is used to handle requests to upstream services such as MySQL, PostgreSQL, Memcached, Redis, or upstream HTTP web services.
GitHub/Documentation: https://github.com/openresty/lua-nginx-module