Problems with fastcgi php migration

Maxim Dounin mdounin at mdounin.ru
Sun Mar 16 01:03:24 MSK 2008


Hello!

On Sat, Mar 15, 2008 at 05:01:19PM -0400, Ian M. Evans wrote:

> Maxim Dounin wrote:
>> [...]
>>> 30680#0: *1202 fastcgi param: "SCRIPT_FILENAME: 
>>> /usr/local/apache/htdocs/test"
>>
>> Looks like you've got wrong SCRIPT_FILENAME. At least - this differs from 
>> the one in the above request.
>
> Thanks....that's why a second set of eyes helps! I stared at that for a 
> while before posting and didn't see it.
>
> Looking at the location, can you see how it's stripping the subdir(s) out? 
> Or how to get the subdirs back in?
>
> Thanks!
>
> location ~ /(testgalleries|galleries|poll|news|photos|test)(/|$) {
> fastcgi_intercept_errors off;
> error_page 404 /404test.php;
> root /usr/local/apache/htdocs;
> set  $script_name  $uri;
> set  $path_info    "";
>

- if ($uri ~ ^/(?:.+/)?(testgalleries|galleries|poll|news|photos|test)(/.*)) {
- set  $script_name  /$1;
+ if ($uri ~ ^(.*/(?:testgalleries|galleries|poll|news|photos|test))(/.*)) {
+ set  $script_name  $1;

> set  $path_info    $2;
> fastcgi_pass 127.0.0.1:10004;
> }

You old regex was capturing only last path component.

Maxim Dounin





More information about the nginx mailing list