Strange rewrite behaviour

Alexander Economou aecon at sysadm.gr
Mon Mar 14 18:37:28 MSK 2011


Greetings again,

I got this weird problem. I have the following virtual domain configuration:


------------------------------------------------------------------------
server {
      listen 80;
      server_name 2.socialwhale.com;
      access_log 
/var/www/cluster-domains/2_socialwhale_com/logs/2.socialwhale.log main;
      error_log 
/var/www/cluster-domains/2_socialwhale_com/logs/2.socialwhale.err;
      index index.html index.htm index.php;
      root  /var/www/cluster-domains/2_socialwhale_com/htdocs/website;


location ~ \.php$ {
             root 
/var/www/cluster-domains/2_socialwhale_com/htdocs/website;
             fastcgi_pass   127.0.0.1:9000;
             fastcgi_index  index.php;
             fastcgi_param  SCRIPT_FILENAME 
/var/www/cluster-domains/2_socialwhale_com/htdocs/website/$fastcgi_script_name;
             include        fastcgi_params;
         }

         error_page  404              /404.html;
        	location = /404.html {
             root   /usr/share/nginx/html;
         }


location  /var/www/cluster-domains/2_socialwhale_com/htdocs/website {
     auth_basic            "Restricted";
     auth_basic_user_file 
/var/www/cluster-domains/2_socialwhale_com/htpasswd;
     }


   }

------------------------------------------------------------------------

Now if i add the following just after the error_page definition

location / {
    try_files $uri $uri/ index.php?$uri&$args;
	}

Nginx says the configuration is ok but php-cgi crashes....

Just so you know i am using those lines to other virtual domains with no 
problem.

Any ideas?

-- 
---
Alex



More information about the nginx mailing list