Nginx 0.8.54: Index files bug?

Maxim Dounin mdounin at mdounin.ru
Fri Feb 11 18:35:39 MSK 2011


Hello!

On Fri, Feb 11, 2011 at 09:13:06AM -0500, Dayo wrote:

> [code]
> server {
> ...
> 	index index.html;
> 	location / {
>                 error_log  /path/to/log  debug;
> 		try_files $uri $uri/;
> 	}
> }
> [/code]
> 
> ...gives me an empty error log file.

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).

> I don't think my isp has cached the response because as soon as I change
> to ...
> 
> [code]
> server {
> ...
> 	index index.html;
> 	location / {
> 		try_files $uri $uri/ @proxy;
> 	}
> }
> [/code]
> 
> It starts working ... using the apache index files setup.

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).

Maxim Dounin



More information about the nginx mailing list