In the lines below, I might have a site-specific configuration file that contains additional fastcgi_params unique to that site. If this file exists I want to load it.
server {
listen 80 default;
server_name _;
root /path/www/$host;
# Pass PHP scripts to php-fastcgi listening on port 9000
location ~ \.php {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
if (-f /path/www/$host/nginx.conf) {
include /path/www/$host/nginx.conf;
}
}
}
However, this doesn't work and the error I get is:
nginx: [emerg] "include" directive is not allowed here in ...
Update
I thought that rather than checking separatly, I could let include check for me.
server {
listen 80 default;
server_name _;
root /path/www/$host;
# Pass PHP scripts to php-fastcgi listening on port 9000
location ~ \.php {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
include /path/www/$host/*.nginx;
}
}
However, this doesn't seem to be working.