Problems with fastcgi php migration

Ian M. Evans ianevans at
Thu Mar 13 16:31:03 MSK 2008

Igor Sysoev wrote:
> If you need throw ways /subdir/subdir/, you can try the followning:
> location ~ /(testgalleries|galleries|poll|news|photos)(/|$) {
>       root /usr/local/apache/htdocs;
>       set  $script_name  $uri;
>       set  $path_info    "";
>       if ($uri ~ ^/(?:.+/)?(testgalleries|galleries|poll|news|photos)(/.*)) {
>             set  $script_name  /$1;
>             set  $path_info    $2;
>             fastcgi_pass       ...
>       }

I added that to the list of locations.

Also, I forgot to note that it needs to be able to handle more path 
after the file name (in the examples a photo slide number) so the full 
URL could end up being:

In the location regex above it would work on

Also, like before, it 404s if the person adds a trailing slash.

So: <--works <--works <-- adding trailing slash tosses a 404 <-- adding additional path tosses a 404

More information about the nginx mailing list