]> git.sven.stormbind.net Git - sven/scripts.git/blobdiff - nginx/show_header.conf
nginx config utilizing inline lua to print all HTTP request header
[sven/scripts.git] / nginx / show_header.conf
diff --git a/nginx/show_header.conf b/nginx/show_header.conf
new file mode 100644 (file)
index 0000000..c592ba1
--- /dev/null
@@ -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
+ }
+}