Welcome! Log In Create A New Profile

Advanced

Logging POST data from $request_body and returning 200

February 24, 2011 07:15PM
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 but when I make the following change:

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;
return 200;
}
location /dummy { set $test 0; }

The logs are recording blank data. Any ideas on record the data with returning a 200?
Subject Author Posted

Logging POST data from $request_body and returning 200

barretto_chris February 24, 2011 07:15PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready