15 messages in ru.sysoev.nginxRe: nginx-0.7.31
FromSent OnAttachments
Igor SysoevJan 19, 2009 6:05 am 
Kevin WorthingtonJan 19, 2009 7:10 am 
cynixJan 19, 2009 8:47 am 
Igor SysoevJan 19, 2009 9:44 am 
cynixJan 19, 2009 6:32 pm 
Igor SysoevJan 19, 2009 11:45 pm 
mikeJan 20, 2009 1:09 am 
Igor SysoevJan 20, 2009 1:17 am 
mikeJan 20, 2009 1:40 am 
Igor SysoevJan 20, 2009 2:14 am 
Igor SysoevJan 20, 2009 3:14 am 
Juan Fco. GiordanaJan 20, 2009 4:22 am 
Igor SysoevJan 20, 2009 4:59 am 
cynixJan 20, 2009 5:47 am 
Igor SysoevJan 20, 2009 6:37 am.dir
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: nginx-0.7.31Actions...
From:cynix (cyn@cynix.org)
Date:Jan 19, 2009 6:32:04 pm
List:ru.sysoev.nginx

Igor Sysoev <is@...> writes:

location ~ (/|\.php)$ { fastcgi_pass ...; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }

This works for the most part, but if I implement a try_files alternative within the location block like this:

location ~ (/|\.php)$ { if (!-f $document_root$fastcgi_script_name) { rewrite ^ @php last; } fastcgi_pass ...; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }

Then nginx will segfault when example.com/test/ is requested. So I can only do this:

location ~ (/|\.php)$ { if (!-e $document_root$uri) { rewrite ^ @php last; } fastcgi_pass ...; ... }

But this doesn't take care of the case where index.php doesn't exist inside a directory. Is $fastcgi_script_name not properly set when used as "if" condition?