9951 explained code solutions for 126 technologies


nginx-luaGet raw request headers with Lua


server {
  location / {
    content_by_lua_block {
      ngx.say(ngx.req.raw_header())
    }
  }
}ctrl + c
content_by_lua_block

nginx-lua module directive to specify block of Lua code

ngx.say

output given text to client

ngx.req.raw_header()

returns raw HTTP request headers (online example)