Welcome! Log In Create A New Profile

Advanced

Re: try_files ignored in combination with error_page and named locations

Edho Arief
April 04, 2012 05:06AM
2012/4/4 Džen <yvldwt@gmail.com>:
> Thank you very much for your clarifying explanation. Seems like the only
> thing missing was "recursive_error_pages on" for it to work like I
> wanted it to have.
>
> On 04/04/12 12:16pm, Ruslan Ermilov wrote:
>> [...]
>>
>> First, this is a wacky config, and I don't quite understand what
>> you're trying to achieve with it.  :)
>
> Just to make you understand what I was trying to achieve with this
> config: my maintenance page contains img tags pointing to images located
> in $document_root. I used to add a simple
>
>        try_files /$hostid-maintenance/ @backend;
>
> to my configuration, but as expected a request to /foo.png returns the
> contents of /$hostid-maintenance/index.html instead. Thus I was looking
> for a solution to use a whole directory as an error page (being able to
> request other files which are located inside the maintenance
> $document_root).
>

location /maintenance-static/ {

}

location / {
try_files /$hostid-maintenance/ @backend;
}

_______________________________________________
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: 82
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