Problems with fastcgi php migration
Ian M. Evans
ianevans at digitalhit.com
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:
example.com/subdir/photos/1
example.com/subdir/subdir/photos/1
In the location regex above it would work on example.com/subdir/photos/1
Also, like before, it 404s if the person adds a trailing slash.
So:
example.com/subdir/photos <--works
example.com/subdir/subdir/photos <--works
example.com/subdir/photos/ <-- adding trailing slash tosses a 404
example.com/subdir/photos/1 <-- adding additional path tosses a 404
More information about the nginx
mailing list