Created
September 7, 2018 13:03
-
-
Save aduzsardi/962524fe8417e0e7ce1804519ba67654 to your computer and use it in GitHub Desktop.
nginx - log post body to stdout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /events { | |
if ($request_method = POST) { | |
access_log /dev/stdout post_body if=$loggable; | |
proxy_pass $scheme://127.0.0.1/logsink; | |
break; | |
} | |
return 200 "ok"; | |
} | |
location /logsink { | |
return 200 "ok"; | |
} | |
map $request_body $loggable { | |
'' 0; | |
'-' 0; | |
default 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment