Summary

The chapter is aimed at extending NGINX request processing using Lua. Lua is a powerful, dynamic scripting language. This language implements a small set of features. It has a rather small memory footprint and can be embedded on various host systems using the LuaJIT interpreter. NGINX has the ngx_lua module, which enables Lua scripts in NGINX request processing. This chapter described the module directives and their integration into the life cycle phases of NGINX requests.

The NGINX-Lua integration also provides an API, exposed as the ngx and ndk packages. These packages can be used to interact with other NGINX components. The packages can also be imported into external Lua scripts. The API has been integrated with the NGINX event loop. Thus, all I/O should be performed using these packages to avoid a performance hit. In the end, the chapter used the module directives, API, and third-party Lua libraries to build an example of custom request processing.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.17.137