Skip to content

Instantly share code, notes, and snippets.

@morhekil
Created August 7, 2014 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morhekil/5b7d778f6c12af7ab33d to your computer and use it in GitHub Desktop.
Save morhekil/5b7d778f6c12af7ab33d to your computer and use it in GitHub Desktop.
data sink for nginx
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;
}
}
@morhekil
Copy link
Author

morhekil commented Aug 7, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment