From: Sven Hoexter Date: Sat, 1 Dec 2018 12:51:12 +0000 (+0100) Subject: nginx config utilizing inline lua to print all HTTP request header X-Git-Url: https://git.sven.stormbind.net/?a=commitdiff_plain;h=9f2cba27b070a480756edb80d3fc0a76ca7c407f;p=sven%2Fscripts.git nginx config utilizing inline lua to print all HTTP request header prints out all HTTP request header as received by the nginx server --- diff --git a/nginx/show_header.conf b/nginx/show_header.conf new file mode 100644 index 0000000..c592ba1 --- /dev/null +++ b/nginx/show_header.conf @@ -0,0 +1,11 @@ +# output all HTTP header as received by nginx +location /header { + default_type 'text/plain'; + content_by_lua_block { + local myheads=ngx.req.get_headers() + for key in pairs(myheads) do + local outp="Header '" .. key .. "': " .. myheads[key] + ngx.say(outp) + end + } +}