NGINX : Proxy pass intercepting 5xx errors - Possible to differentiate between ones fired by backed vs ones fired by nginx itself?

Posted by anonymous-one on Server Fault See other posts from Server Fault or by anonymous-one
Published on 2012-09-16T17:42:46Z Indexed on 2012/09/17 3:40 UTC
Read the original article Hit count: 457

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.

© Server Fault or respective owner

Related posts about nginx

Related posts about logging