How to log POST body data?

I’m trying to use $request_body but get ‘-’ in my log file for this
field
here is my configure file, is there sth wrong or the $request_body has
other
deps to work?

http {
log_format client '$remote_addr - $remote_user $request_time
$upstream_response_time ’
'[$time_local] “$request” $status $body_bytes_sent
$request_body “$http_referer” ’
‘“$http_user_agent” “$http_x_forwarded_for”’;

server {

location = /c.gif {
empty_gif;
access_log logs/uaa_access.log client;
}

}
}

I’m using linux command ‘curl -d name=xxxx myip/my_location’ to fire a
POST
request, and just get ‘-’ for $request_body field.

Posted at Nginx Forum:

Hi,

Trying adding this directive to your location:
echo_read_request_body;

It needs this 3rd party module though:

yes, it works! thanks a lot

Posted at Nginx Forum:

Followups,
I used echo_read_request_body; and the empty_gif directive seems not
work
again, they shoud be exclusive in a location?

John W. Wrote:

wrote:

$upstream_response_time ’


nginx mailing list
[email protected]
nginx Info Page


nginx mailing list
[email protected]
nginx Info Page

Posted at Nginx Forum: