Logging POST body

Maxim Dounin mdounin at mdounin.ru
Wed Oct 15 18:13:48 UTC 2014


Hello!

On Wed, Oct 15, 2014 at 12:50:23PM -0400, keeyong wrote:

> I am using ngixing as a reverse proxy in front of apache (PHP) as a load
> balancer and a logger. For some endpoints, I want to log their POST bodies
> and I looked up the Web and found some solution requiring to install
> HttpEchoModule. Is there any other way of achieving this? Preferably without
> installing any new module?

Yes, you can access a request body either via $request_body 
variable, or with, if it's saved to a file, via $request_body_file 
variable.

Related documentation links:

http://nginx.org/r/$request_body
http://nginx.org/r/$request_body_file
http://nginx.org/r/client_body_in_file_only
http://nginx.org/r/client_body_buffer_size

-- 
Maxim Dounin
http://nginx.org/



More information about the nginx mailing list