try_files and index

Maxim Dounin mdounin at mdounin.ru
Tue Jun 26 07:31:35 UTC 2012


Hello!

On Tue, Jun 26, 2012 at 03:18:29AM -0400, whiskybar wrote:

> I'm afraid I have to disagree on this. That was my guess before I tried
> that too. Here's the relevant part of the log for my first
> configuration, with `try_files $uri =404` only:
> 
> 2012/06/25 21:34:22 [debug] 30604#0: *335710 open index
> "/var/index.html"
> 2012/06/25 21:34:22 [debug] 30604#0: *335710 stat() "/var/index.html"
> failed (
> 2: No such file or directory)
> 
> And btw, this is on Nginx 1.2 64bit (Ubuntu). Why is it happening?

In your first configuration try_files is a nop, as it's defined at 
server level and will be only used if request doesn't match any of 
locations defined.

Maxim Dounin



More information about the nginx mailing list