fastcgi_param in server context does not work

Maxim Dounin mdounin at mdounin.ru
Tue Sep 22 20:00:29 MSD 2009


Hello!

On Tue, Sep 22, 2009 at 05:17:53PM +0200, Tomasz Pajor wrote:

> When I set fastcgi_param in server context it is not set, if in
> location it is set.
> Wiki says it should work in http, server, location context.

Please note that wiki also says:

<quote>
Directives not set are inherited from the outer level. Directives 
set in current level clear any previously defined directives for 
the current level.
</quote>

Note that this is standard behaviour for all array-type directives 
(fastcgi_param, proxy_set_header, access_log, error_log and so on).

Maxim Dounin

> 
> server {
>    listen 80;
>    server_name .landingpage.dev;
>    access_log off;
>    error_log /var/log/nginx/landingpage.log;
> 
>    root /vhosts/landingpage/public;
>    charset utf-8;
> 
>    fastcgi_index index.php;
>    fastcgi_param SITE my_site;
> 
>    location / {
>        try_files $uri $uri/ @fallback;
>        fastcgi_pass unix:/var/run/spawn-fcgi.sock;
>        fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
>        #fastcgi_param SITE my_site;
>        include fastcgi_params;
>    }
> 
>    location @fallback {
>        fastcgi_pass unix:/var/run/spawn-fcgi.sock;
>        fastcgi_param SCRIPT_FILENAME $document_root/index.php;
>        #fastcgi_param SITE my_site;
>        include fastcgi_params;
>    }
> }
> 





More information about the nginx mailing list