variables in "include" for vhost specific config files

Michael Shadle mike503 at gmail.com
Tue Jul 21 20:57:48 MSD 2009


2009/7/21 Igor Sysoev <is at rambler-co.ru>:

> http {
>
>     # here you may set any fastcgi settings expect fastcgi_pass,
>     # and they will be inherited in all servers and locations.
>     fastcgi_index  ...
>     fastcgi_param  ...

The only negative about this is (how Maxim described it) any "array"
type configuration item like fastcgi_param will be reset if you set
this globally, but then add a new index somewhere else.

I set all my fastcgi_params globally in the past, but then I needed to
set fastcgi_param HTTPS on; just for a single server block - and what
happens is the entire set gets reset to nothing besides the HTTPS one.
I thought it would override a value (which it appears to properly) or
add a value.

Of course, one could just set fastcgi_param HTTPS off; and then just
override it on the server, but it is something to caution people
about, unless that behavior has been modified (this was recent though)

Also, I had my fastcgi_params set globally and it appears that my
Django setup (I believe it was) wanted a couple different params and
did not like me defaulting fastcgi_index index.php (which was set
globally), so I wound up doing the separate fastcgi_params config file
(I should call it php.conf) and including it inside of every location
block for php. That guarantees I can add new items like HTTPS on too -
the array structure isn't killed if it is inside of the same location
block it seems...





More information about the nginx mailing list