Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

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

1 Answer 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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.