Problems with fastcgi php migration

Igor Sysoev is at rambler-co.ru
Wed Mar 12 00:45:38 MSK 2008


On Tue, Mar 11, 2008 at 04:56:24PM -0400, Ian M. Evans wrote:

> Igor Sysoev wrote:
> >nginx does set any content-type for proxied and fastcgi responses.
> >It should be set by backend.
> 
> Then maybe it's not that.
> 
> Can you think of any other reason why browsers would be trying to 
> download the extensionless files as opposed to seeing them as web pages? 
> As I said last night, the setting you suggested for the extensionless 
> files produced these results:
> 
> > location ~ ^/(galleries|poll|news)/ {
> 
> In IE7:
> calling /galleries/ causes a 404
> calling /galleries runs the script as expected
> 
> In Firefox:
> calling /galleries/ causes a 404
> calling /galleries gives a "Open with.../Save to disk" octet stream 
> dialogue.

You need to change:

- 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;
       ...
   }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list