Problems with fastcgi php migration

Ian M. Evans ianevans at digitalhit.com
Wed Mar 12 01:17:50 MSK 2008


Igor Sysoev wrote:
> - location ~ ^/(galleries|poll|news)/ {
> + location ~ ^/(galleries|poll|news)(/|$) {
> 
> because otherwise nginx handles /galleries, etc. as local files.
> 
> Then probably you need to set PATH_INFO:
> 
>    location ~ ^/(galleries|poll|news)(/|$) {
>        set  $path_info  "";
>        if ($uri ~ ^/[^/]+(/.+)) {
>            set  $path_info  $1;
>        }
> 
>        fastcgi_pass ...
>        fastcgi_param  PATH_INFO $path_info;
>        ...
>    }
> 

The results:

Firefox:
Calling /galleries pulls up page. Adding further info (e.g. /30/1/1) 
pulls up photo page as expected.

Calling /galleries/ (with trailing slash) still pulls up a 404 error.

IE7:
/galleries creates same passing result as Firefox.
/galleries/, like Firefox calls up the 404 page.

So we're much, much closer...only stumbling block is getting it to run 
properly if a visitor adds a trailing slash. Is that just a matter of 
forcing no trailing slash if there's nothing else following it?

Thanks.





More information about the nginx mailing list