Welcome! Log In Create A New Profile

Advanced

Re: Nginx 0.8.54: Index files bug?

Maxim Dounin
February 11, 2011 11:12AM
Hello!

On Fri, Feb 11, 2011 at 10:43:19AM -0500, Dayo wrote:

> Hi Maxim!
>
> Maxim Dounin Wrote:
> -------------------------------------------------------
> > Hello!
> > It should log something like "rewrite or internal
> > redirection
> > cycle" at "error" level. Obviously enough your
> > config creates an
> > infinite loop on processing "/" as you set
> > try_files's fallback to
> > effectively the same uri, just with extra "/"
> > added.
> >
> > No idea why you have no logs - most likely you did
> > something wrong
> > (e.g. nginx has no access rights to write the file
> > in question and
> > config wasn't actually loaded due to this error,
> > but you've
> > overlooked related messages in global error_log).
>
> The error log file does log other errors.

This is fine, but doesn't explain why don't see the one in
question. It's hard to say anything without seeing the full
config.

> > This one should use index.html as an index (and
> > fallback to @proxy
> > if no index.html found or there is no directory at
> > all).
> Correct. It only works because it is falling back to apache.
>
> Did you see my previous post?
> When I comment out the try files directive, the index works.

Again:

location / {
try_files $uri $uri/;
}

is an infinite loop. It is expected to generate 500 for
directories. Under no conditions it will allow index to work.

This is what you wrote in your config: check if file (not
directory) "$uri" exists, if not - do internal redirect to
"$uri/".

If you want nginx to return 404 if no file or directory exists -
use

location / {
try_files $uri $uri/ =404;
}

Or, better, just don't use try_files - it's not needed here.
Index and static modules will generate 404 as appropriate.

Maxim Dounin

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

Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 06:45AM

Re: Nginx 0.8.54: Index files bug?

Igor Sysoev February 11, 2011 06:54AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 07:16AM

Re: Nginx 0.8.54: Index files bug?

Igor Sysoev February 11, 2011 07:48AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 08:33AM

Re: Nginx 0.8.54: Index files bug?

Igor Sysoev February 11, 2011 08:50AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 09:13AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 10:36AM

Re: Nginx 0.8.54: Index files bug?

Maxim Dounin February 11, 2011 10:38AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 10:43AM

Re: Nginx 0.8.54: Index files bug?

Igor Sysoev February 11, 2011 11:00AM

Re: Nginx 0.8.54: Index files bug?

Maxim Dounin February 11, 2011 11:12AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 11:29AM

Re: Nginx 0.8.54: Index files bug?

Dayo February 11, 2011 12:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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