O'Reilly logo

NGINX High Performance by Rahul Sharma

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The NGINX-Lua API

The nginx_lua module provides an API that can be called in the Lua code to interact with other NGINX components. The complete API is exposed in the form of two packages, namely, ngx and ndk. These packages are available within the ngx_lua directive and can be imported in external Lua modules using the require statements. The API has been integrated into the NGINX event loop, so all I/O operations in the Lua code must be performed using the exposed API to avoid performance bottlenecks.

The complete API is quite comprehensive and provides methods to interact with every feature of NGINX. It is available at http://wiki.nginx.org/HttpLuaModule#Nginx_API_for_Lua. The following section provides an overview of the exposed API.

ngx.arg ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required