Created
August 7, 2014 12:53
-
-
Save morhekil/5b7d778f6c12af7ab33d to your computer and use it in GitHub Desktop.
data sink for nginx
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
http { | |
log_format datasink $request_body; | |
} | |
server { | |
listen 1.2.3.4; | |
location /datasink { | |
return 200; | |
} | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_redirect off; | |
proxy_pass $scheme://1.2.3.4:$server_port/datasink; | |
access_log /var/log/nginx/datasink.log datasink; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nginx data sink allows to easily debug various incoming requests and capture samples of real traffic as received by the webserver, with no extra tools (nc?) needed. Shown are only relevant parts of the configuration, you might want to extend at least http part of it with necessary directives.