From 9f2cba27b070a480756edb80d3fc0a76ca7c407f Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Sat, 1 Dec 2018 13:51:12 +0100 Subject: [PATCH] nginx config utilizing inline lua to print all HTTP request header prints out all HTTP request header as received by the nginx server --- nginx/show_header.conf | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 nginx/show_header.conf 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 + } +} -- 2.39.2