3

How do you log the response body (not request body) in nginx? I could not find such a variable in any of the modules (only the request body).

We are using nginx as a reverse proxy/loadbalancer and would like to parse our API requests & responses from nginx logs.

Thank you!

2
  • I don't know anything like mod_security for Apache, that allows such type of logging. Maybe a 3Party Module?
    – grosshat
    May 22, 2012 at 12:56
  • serverfault.com/a/479123 might answer the question.
    – kojo
    Nov 7, 2013 at 10:38

1 Answer 1

1

You could log the headers using $upstream_http_HEADER. Doesn't seem like there is a variable for the response body though but I'm not surprised - this part would be optimized.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .