Why is it my first configuration returns 403 while my second
configuration returns 404?
I looked into logs and it seems my first configuration triggers the
index module which is set to the default index.html, finds nothing and
returns 403. Why isn’t the =404 triggered? And why is the index module
triggered at all?
My second configuration works more like I expected; but then, why isn’t
the index module triggered as well? Does try_files disable the index
module somehow?
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?
On Tue, Jun 26, 2012 at 03:18:29AM -0400, whiskybar wrote:
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.
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.
That explains it then. Thank you very much Maxim!
@Edho there was no /var/index.html because I was forcing a 404 in this
snippet.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.