lua-nginx-module is a module that embeds Lua scripting into NGINX HTTP servers.
The module addresses the need to extend NGINX with dynamic logic by allowing Lua code to run within the NGINX request processing pipeline. It provides a full Nginx API for Lua, enabling developers to write request handlers, filters, and other HTTP processing logic directly in Lua rather than compiling C modules. The module is a core component of OpenResty and can be built as either a static or dynamic module alongside NGINX.
The tool suits projects that need to add application logic to NGINX without writing C code or running separate application servers. It works well for API gateways, request routing, authentication, rate limiting, and other HTTP middleware tasks where the overhead of external services is undesirable. Developers should be aware that the module is not distributed with standard NGINX and requires custom compilation. The README documents known limitations including restricted coroutine yielding in certain contexts, limited cosocket availability in some request phases, and incomplete support for SPDY mode.
The project maintains a comprehensive test suite and accepts bug reports and patches through its community channels. Development activity includes regular updates to address compatibility with evolving NGINX versions and Lua/LuaJIT improvements. The module supports LuaJIT bytecode compilation for startup performance optimization and allows statically linking pure Lua modules into the build.