I have successfully set up PHP to work with my nginx server using this location block:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
The problem is that I have a lot of vhosts (server blocks for other websites) in their own config files. These are then placed in a folder called sites-enabled, which are loaded by nginx.
To enable PHP for all my vhosts, I need to put the above snippet into all the config files. Is there anyway I can ask nginx to interpret all PHP files using PHP without having to put the location block into all the server blocks?
Thank you :)