This code will dump the request headers into the response body of an nginx location. It is intended for degugging development and not for production. The code has been tested on OpenResty.
location /status {
default_type text/html;
lua_code_cache off; #enables livereload for development
content_by_lua_file lua/status_page.lua;
}
ngx.say('<pre>' .. ngx.req.raw_header() .. '</pre>')
GET /status HTTP/1.1
X-Forwarded-For: 192.168.1.10
X-Forwarded-Proto: https
X-Forwarded-Port: 443