Log POST data to file for debugging

Hi,

We have an issue with some software in the field which makes requests
back to our webservers. We need to log the IP of each request, the
referrer string and the POST data. Standard logs take care of the first
two, but how can I write out the POST data as well?

Some research suggests that I can use the $request_body to grab this
information, but I’m not sure when it’s populated/flushed and also
whether I can write out directly from nginx or whether I need a custom
module.

I’m using nginx 0.7.64 on Gentoo (amd64) with 2.6.21-xen kernel.

Any help would be greatly appreciated :smiley:

Dave