![]() ![]() ![]() That writes out 88, the sum of 32 and 56. 'return tonumber(ngx.arg) + tonumber(ngx.arg)' When this is used in the context of the set_by_lua* directives, this table is read-only and holds the input arguments to the config directives: Delegating all network and disk I/O operations to Nginx's subrequests (via the method and similar) is strongly recommended for maximum performance.Ĭontext: set_by_lua*, body_filter_by_lua* Disk operations with relatively small amount of data can be done using the standard Lua io library but huge file reading and writing should be avoided wherever possible as they may block the Nginx process significantly. Network I/O operations in user code should only be done through the Nginx Lua API calls as the Nginx event loop may be blocked and performance drop off dramatically otherwise. The ability to require these packages was introduced in the v0.2.1rc19 release. It is also possible to directly require the packages in external Lua modules: Use of the eall flag is strongly discouraged due to its various bad side-effects. The packages can be introduced into external Lua modules like this: These packages are in the default global scope within ngx_lua and are always available within ngx_lua directives. The API is exposed to Lua in the form of two standard packages ngx and ndk. The Nginx Lua API described below can only be called within the user Lua code run in the context of these configuration directives. The various *_by_lua, *_by_lua_block and *_by_lua_file configuration directives serve as gateways to the Lua API within the nf file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |