2 messages in ru.sysoev.nginxRe: Proxy requests return 404 when ba...
FromSent OnAttachments
Ezra ZygmuntowiczDec 29, 2006 4:58 pm 
Igor SysoevDec 29, 2006 11:33 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Proxy requests return 404 when backends down how to return appropriate 50x error?Actions...
From:Igor Sysoev (is-G@public.gmane.org)
Date:Dec 29, 2006 11:33:47 pm
List:ru.sysoev.nginx

On Fri, 29 Dec 2006, Ezra Zygmuntowicz wrote:

I am using a standard nginx config for proxying to mongrel for rails apps. I have this for error pages:

error_page 500 502 503 504 /50x.html; location = /50x.html { root html; }

But when my backend mongrels are down nginx always returns a 404 instead of a 500x error. Do I need to catch the 404 from proxy going down and show my own error? Or is there something I am missing. Do all failed proxy requests return 404 instead of 502 or 503?

Look error_log, there should be the error lines:

"... [error] ... open() ".../html/50x.html" failed (2: No such file or directory), ..."

You need to place the "/50x.html" page here or set another "root" for it.