Welcome! Log In Create A New Profile

Advanced

try_files ignored in combination with error_page and named locations

Džen
April 03, 2012 04:32PM
Hello,

For some reason the following nginx configuration snippet doesn't work
as expected, try_files seems to be ignored. When / is requested (or any
other URI which points to a file which doesn't exist), nginx's default
503 page is returned instead of the existing index.html. Requesting
/index.html works correctly.

location @maintenance {
root /var/nginx/$hostid-maintenance;
index index.html;
try_files $uri $uri/ / =500;
}

error_page 503 @maintenance;

if ( -d $document_root/$hostid-maintenance ) {
return 503;
}

Any thoughts? Running nginx version 1.0.12 here.

Kind regards

--
Džen

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

try_files ignored in combination with error_page and named locations

Džen April 03, 2012 04:32PM

Re: try_files ignored in combination with error_page and named locations

Ruslan Ermilov April 04, 2012 04:18AM

Re: try_files ignored in combination with error_page and named locations

Džen April 04, 2012 04:50AM

Re: try_files ignored in combination with error_page and named locations

Edho Arief April 04, 2012 05:06AM

Re: try_files ignored in combination with error_page and named locations

Džen April 04, 2012 01:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 139
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