I am able to log POST data correctly with the following code: location /bk { if ($request_method != POST) { return 405; } proxy_pass $scheme://127.0.0.1:$server_port/dummy; log_format my_tracking $request_body; access_log /mnt/logs/nginx/my.access.log my_tracking; } location /dummy { set $test 0; } but the requester gets a 404 return code. I'd like to return a 200 butby barretto_chris - Nginx Mailing List - English
Great discussion even though this was posted a year ago! I was looking for information on capturing the POST request body and this cleared things up quite a bit on what is going on under the hood. My problem is slightly different in that I just want to log the request body. I have my config setup to handle a bunch of GET requests which render pixels that work fine to handle analytics and parseby barretto_chris - Nginx Mailing List - English
I have my config setup to handle a bunch of GET requests which render pixels that work fine to handle analytics and parse query strings for logging. With an additional third party data stream, I need to handle a POST request to a given url that has JSON in an expected loggable format inside of it's request body. I don't want to use a secondary server with proxy_pass and just want to log the wholeby barretto_chris - Nginx Mailing List - English