I guess those lines were taken from the 'fastcgi_params' file..
Basically you are not getting any errors when it comes to SCRIPT_FILENAME
because it's already defined when you defined your root directive in your vhost file. So unless you defined it explicitly in your vhost file using fastcgi_param
the value of SCRIPT_FILENAME
would be taken from the root directive.. But ONE IMPORTANT POINT HERE. There is another variable that nginx needs in order to send the requests to the php server which is $fastcgi_script_name
and you have to define it well in order to avoid repetitive URLs and errors with uri's that end with slash.
Conclusion:
To make everything work super nice, everyone should define SCRIPT_FILENAME
explicitly either in 'fastcgi_params' file located in /etc/nginx folder or easily in the vhost of your site located in sites-available folder by including the following line in the php location block:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
or included in the 'fastcgi_params' file as you wrote above, either way it's the same.. For more info for connecting ngnix to PHP-FPM go to:
https://www.nginx.com/resources/wiki/start/topics/examples/phpfcgi/
I hope it would help anyone in the future 'cuz it took me a lot of time to figure it out..