9951 explained code solutions for 126 technologies


nginx-luaHow to get query params


server {
  location / {
    content_by_lua_block {
      ngx.say(ngx.var.arg_test)
    }
  }
}ctrl + c
server {

virtual host configuration block

location

specific location (group of URLs) configuration

content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.say

output given text to client

ngx.var

access request query string parameters

arg_test

get test query string parameter value (e.g. /?test=hi will output hi)