Looking for help on fastcgi with different path

Artifex Maximus artifexor at gmail.com
Thu Jun 18 15:41:43 MSD 2009


Hello!

I have the following config file, excerpt:

location / {
  root /home/;
  index index.php index.html index.htm;
  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME /home$fastcgi_script_name;
    include fastcgi_params;
  }
}

location /x/ {
  alias  /stat/;
  index  index.php index.html index.htm;
  location  ~  \.php$ {
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME /stat$fastcgi_script_name;
    include  fastcgi_params;
  }
}

Because of different path I need to generate a different
SCRIPT_FILENAME inside location /x/. But with this config file nginx
looks for /stat/x/... file instead of /stat/... file. How should I
solve this?

Another question. Is there any global fastcgi setup as lighttpd has? I
mean that I give globally only the host, port, socket and other
parameters (like SCRIPT_FILENAME) are generated by nginx.

Bye,
Zsolt





More information about the nginx mailing list