After upgrading nginx on my server, all PHP sites stopped working. Before, I had just this in the file "fastcgi_params":
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
And then the PHP site config files had a block like this inside:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
However, this no longer works. It only works if I have this in the per-site config files:
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
I have to have the SCRIPT_FILENAME being set here, and not in "fastcgi_params". It also has to have $document_root in front of it now. Neither "$document_root$fastcgi_script_name" nor "$fastcgi_script_name" work if set in the included fastcgi_params file.
I'm not that concerned that I now have to prepend it with $document_root (but I am curious, if anyone knows why that broke or why it was working before), but I'd prefer to keep common functionality in the fastcgi_params file for simplicity so I'd like to know why that isn't working.