![]() Module instead, which offers a compatible Lua API. If you want to do generic TCP communications with theĭownstream clients, then you should use the This module is plugged into Nginx's "http" subsystem so it can only speaksĭownstream communication protocols in the HTTP family (HTTP 0.9/1.0/1.1/2.0, Small memory footprint in Lua even when under heavy loads. Loaded Lua modules persist in the Nginx worker process level resulting in a Request contexts are segregated using lightweight Lua coroutines. Shared across all the requests in a single Nginx worker process to minimize The Lua interpreter (also known as "Lua State" or "LuaJIT VM instance") is Subrequests to access the Nginx upstream modules because the former is usually Recommended to use those lua-resty-* libraries instead of creating PostgreSQL, Memcached, Redis, or upstream HTTP web services.Īt least the following Lua libraries and Nginx modules can be used with thisĪlmost any Nginx modules can be used with this ngx_lua module by means of ![]() This module is used to handle requests to upstream services such as MySQL, Traffic as long as the Nginx API for Lua provided by Lua code executed using this module can be 100% non-blocking on network Powerful Lua threads (known as Lua "coroutines") into the Nginx event model. ![]() Thisĭocument interchangeably uses the terms "Lua" and "LuaJIT" to refer to theīy leveraging Nginx's subrequests, this module allows the integration of the Interpreter (also known as "PUC-Rio Lua") is not supported anymore. Since version v0.10.16 of this module, the standard Lua This module, then you are essentially using OpenResty. This module embeds LuaJIT 2.0/2.1 into Nginx. # try access /nginx_var?a=hello,world content_by_lua_block # MIME type determined by default_type: default_type 'text/plain' # set search paths for Lua external libraries written in C (can also use ' '): lua_package_cpath '/bar/baz/?.so /blah/blah/?.so ' # set search paths for pure Lua external libraries (' ' is the default path): lua_package_path '/foo/bar/?.lua /blah/?.lua ' You are welcome to subscribe to our official YouTube channel, OpenResty. ![]() YouTube video " Precompile Lua Modules into LuaJIT Bytecode to Speedup OpenResty Startup" YouTube video " Measure Execution Time of Lua Code Correctly in OpenResty" YouTube video " OpenResty's resty Command-Line Utility Demo" YouTube video " Write Your Own Lua Modules in OpenResty/Nginx Applications" YouTube video " Hello World HTTP Example with OpenResty/Lua"
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |