multihop 502s

Adam Wiggins adam at
Tue May 13 09:03:55 MSD 2008

Hello all,

I've been trying to get Nginx to do multiple hops on error page
failovers.  Like a cache miss on memcache (404) followed by a bad
gateway on the main server ending up at a fallback server.  Here's a
simplified example:

location / {
    error_page 404 502 = @main;

location @main {
    error_page 502 = @fallback;

    proxy_pass http://main_server;

location @fallback {
    proxy_pass http://fallback_server;

However, the second 502 doesn't get triggered, it just shows the
standard Nginx 502 page.  It works as expected when the first hop
(memcache) is removed.

Is a multi-hop 502 possible?


More information about the nginx mailing list