Different error code during proxied backend restart?

At the moment, nginx (I use 0.5.33) reports 404 (Not Found) when the
(reverse-) proxied backend is unavailable (for example, while it is
being restarted).

I think it is somewhat confusing, both for normal users, and for bots.

Wouldn’t it be better to report 503 (Service Unavailable)?

On Mon, Dec 17, 2007 at 02:48:58PM +0100, Marcin K. wrote:

At the moment, nginx (I use 0.5.33) reports 404 (Not Found) when the
(reverse-) proxied backend is unavailable (for example, while it is
being restarted).

I think it is somewhat confusing, both for normal users, and for bots.

Wouldn’t it be better to report 503 (Service Unavailable)?

In this case nginx reports 502.
Could you make debug log of this request ?

In this case nginx reports 502.
Could you make debug log of this request ?

I found what is going on, finally. nginx indeed wants to report 502,
but then fails to find the file for 502 error:

2007/12/17 18:55:00 [error] 28745#0: *6 connect() failed (111:
Connection refused) while connecting to upstream, (…)
2007/12/17 18:55:00 [error] 28745#0: *6 open()
“/var/www/nginx-default/50x.html” failed (2: No such file or directory),
(…)

nginx wants to load this file as I have in my nginx.conf the line
(IIRC put there by default in the debian package)

error_page 500 502 503 504 /50x.html;

but the 50x.html file is in /var/www/nginx-errors, not in
/var/www/nginx-default.

So in the end it seems like some packaging inconsistency or my
forgotten mistake (I do not remember myself messing with those
params or files, but maybe …).

PS I am still not sure whether it would not be better to keep the
original error here, but I do not know for sure.