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?



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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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