Welcome! Log In Create A New Profile

Advanced

Internal marked 503 error page returns default 404

Ádám Joó
August 21, 2015 10:32PM
Hi,

I have the following configuration:

server {
location = /unavailable.html {
internal;
}

try_files $uri =503;

error_page 503 /unavailable.html;
}

My goal is to have all existing files with the exception of
unavailable.html served with 200, and serving unavailable.html with
503 for anything else and itself.

The location is marked as internal because otherwise a direct request
for /unavailable.html would result in a 200. The expectation is that
on a direct request it would be deemed non-existent by try_files, so a
503 would be issued, and through an internal redirect unavailable.html
would eventually be served.

Requesting /unavailable.html, however, results in the default 404
served, which is, after all, consistent with the documentation, but is
not what one would expect it to do.

The exact same problem was stated in a Server Fault question in 2011,
but it was never answered
http://serverfault.com/questions/230433/nginx-error-page-and-internal-directives-not-working-as-expected

Can anyone please shed some light on this?


Thanks,
Ádám

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Internal marked 503 error page returns default 404

Ádám Joó August 21, 2015 10:32PM

Re: Internal marked 503 error page returns default 404

Francis Daly August 22, 2015 07:56PM

Re: Internal marked 503 error page returns default 404

Joó Ádám August 24, 2015 05:34PM

Re: Internal marked 503 error page returns default 404

ryd994 August 24, 2015 10:40PM

Re: Internal marked 503 error page returns default 404

Francis Daly August 25, 2015 06:10PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 265
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready