Welcome! Log In Create A New Profile

Advanced

Re: Try_files and location blocks

António P. P. Almeida
June 23, 2011 06:48PM
On 23 Jun 2011 23h29 WEST, dave@jetcafe.org wrote:

> Thanks very much for looking at this.
>
> appa@perusio.net writes:
>> Also your later config could be simplified:
>> server {
>> ...
>> location / {
>> try_files $uri $uri/ /error.php?c=404 =404;
>>>
>>>
>
> Where is this "=" notation documented? That try_files line looks
> exactly like what I'm trying to do and appears much more elegant.

http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#try_files

Use google translate :) Yes it's missing from the wiki :(

> I was under some impression that try_files could not take arguments
> with a URI, which may be an assumption based on the name of the
> directive. It's not really documented that try_files can do this
> either, unless I'm looking in the wrong place?

It's explicitly stated in the wiki that you *must* specify the args
because in the try_files directive they're not preserved as opposed to
what happens in a rewrite directive.

> http://wiki.nginx.org/CoreModule#try_files
>
> Right?

Yep.

> Finally, exactly what happens if you have location blocks but none
> of them match and you haven't specified a default?

You should get a 404.

--- appa

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

Try_files and location blocks

Dave Hayes June 23, 2011 05:38PM

Re: Try_files and location blocks

António P. P. Almeida June 23, 2011 06:04PM

Re: Try_files and location blocks

António P. P. Almeida June 23, 2011 06:12PM

Re: Try_files and location blocks

António P. P. Almeida June 23, 2011 06:20PM

Re: Try_files and location blocks

Dave Hayes June 23, 2011 06:30PM

Re: Try_files and location blocks

António P. P. Almeida June 23, 2011 06:48PM

Re: Try_files and location blocks

António P. P. Almeida June 23, 2011 07:02PM

Re: Try_files and location blocks

Dave Hayes June 24, 2011 02:16PM

Re: Try_files and location blocks

António P. P. Almeida June 24, 2011 02:52PM

Re: Try_files and location blocks

Dave Hayes June 24, 2011 07:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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