Welcome! Log In Create A New Profile

Advanced

try_files does not have any effect on existing files

February 19, 2017 12:42PM
usually you would have something like this in your config:

location / {
try_files $uri $uri/ /index.php
}

which works pretty good (1.11.10) - however it seems, that if you are requesting a physical file it will work anyway und the try_files gets ignored - so the following will work just as well:

location / {
try_files /foobar /index.php
}

This means, I can not for example overwrite an existing physical file location with a config like this:

location / {
try_files /$host$uri /index.php
}

Since if $uri exists under the root/alias it will be served directly without triggering that try_files directive.

Am I doing something wrong - or is this expected behaviour?
Subject Author Posted

try_files does not have any effect on existing files

weheartwebsites February 19, 2017 12:42PM

Re: try_files does not have any effect on existing files

Francis Daly February 19, 2017 02:42PM

Re: try_files does not have any effect on existing files

weheartwebsites February 19, 2017 05:58PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 77
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready