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.

We use proxy_intercept_errors ( http://wiki.nginx.org/HttpProxyModule#proxy_intercept_errors ) with our backends.

We intercept a number of status codes, including a few 5xx ones.

Our 5xx (each 500 has its own) handler has an access_log so we can see all the 5xx errors returned to the user in a nice clean logged format.

The issue with this is that as it stands now, we cannot tell weather a 5xx was returned to the user by nginx or intercepted from our backend.

Is there any way to differentiate between the two?

Thanks.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

500 is a pretty serious error for nginx itself, so it always records about it to the error log. And this will not happen if the error has been returned from backend.

share|improve this answer
    
correct. since we run haproxy behind nginx, when the primary nginx upstream fails, we enabled request logging in haproxy and it turns out yes, its haproxy sending back the 5xx. so long story short: entry in 5xx log + nginx error log = returned by nginx, entry in 5xx log only = returned by backend. thanks! –  anonymous-one Sep 17 '12 at 7:20

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.