Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We use 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?


share|improve this question
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


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.