Welcome! Log In Create A New Profile

Advanced

Re: Minimal configuration

Francis Daly
February 17, 2014 03:44AM
On Mon, Feb 17, 2014 at 12:42:28AM +0100, B.R. wrote:

Hi there,

> If I may, there is still a little something bothering me:
> The condition required for a loop to be created is that $uri (= /) doesn't
> match any file, thus redirecting and trying again.
> Why on Earth does '/' as error handler matches anything then?

I may be being confused by terminology here. Where does "error handler"
come in to it?

try_files takes multiple arguments -- at least one "file", plus one "uri".

If it gets that far, there is an internal redirect to the final argument.

The other arguments are tried in turn, by prepending $document_root and
seeing if there is a file or directory with that name available. (If
the argument ends in /, it looks for a directory; otherwise it looks
for a file.)

The first matching file-or-directory is processed in the current context.

If that isn't clear, all I can suggest is that you read the source
and/or test, and write the documentation that would make it clear to you,
and submit that to the official docs.

> Stated otherwise, why does '/' as error handler uses index files to find
> something while '/' contained in $uri doesn't find anything? Isn't the
> 'index' directive used there?

try_files doesn't use "index".

try_files can see that (if the current "file" argument ends in a /)
the directory exists, and that therefore this request should be served
by this "file" in this context. After that, "index" can apply and you get
index.html or 403 or whatever else is appropriate.

f
--
Francis Daly francis@daoine.org

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

Minimal configuration

B.R. February 15, 2014 06:32AM

Re: Minimal configuration

Francis Daly February 15, 2014 04:56PM

Re: Minimal configuration

B.R. February 16, 2014 02:46PM

Re: Minimal configuration

Francis Daly February 16, 2014 04:40PM

Re: Minimal configuration

B.R. February 16, 2014 05:02PM

Re: Minimal configuration

Francis Daly February 16, 2014 05:26PM

Re: Minimal configuration

B.R. February 16, 2014 06:44PM

Re: Minimal configuration

Francis Daly February 17, 2014 03:44AM

Re: Minimal configuration

B.R. February 17, 2014 08:16AM

Re: Minimal configuration

Francis Daly February 17, 2014 03:38PM

Re: Minimal configuration

B.R. February 17, 2014 05:18PM

Re: Minimal configuration

Francis Daly February 20, 2014 04:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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