9951 explained code solutions for 126 technologies


nginx-luaGet POST variable value


server {
  location / {
    content_by_lua_block {
      local test = ngx.req.get_post_args()["test"]
      ngx.say(test)
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.req.get_post_args()

get all posted variables

"test"

sample post variable to get value of

ngx.say

output given text to client