2011年2月24日星期四

Logging POST data from $request_body and returning 200

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?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,178228,178228#msg-178228


_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论