Try_files and location blocks

Dave Hayes dave at
Fri Jun 24 02:29:43 MSD 2011

Thanks very much for looking at this. 

appa at 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. 

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?


Finally, exactly what happens if you have location blocks but none of
them match and you haven't specified a default?
Dave Hayes - Consultant - Altadena CA, USA - dave at 
>>> The opinions expressed above are entirely my own <<<

It is only knowledge that will destroy bias.

More information about the nginx mailing list