Reference Link: http://blog.csdn.net/iefreer/article/details/44293711
This problem is usually caused by an incorrect path to the Fastcgi_script_name access script.
Especially with subdirectories, for example, for YII frameworks, the path is usually project/web
Then if you access/project/index.php in the URL, then the script_name in the Nginx configuration will be the full path: project/index.php
If the code in your configuration is as follows:
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Then the actual access to the file is/var/site_root/project/web/project/index.php, which is obviously not the result we want, we want to visit is/project/web/index.php.
These errors can be traced by looking at the Php-fpm.log (error log).
The workaround is to modify the appropriate path configuration.
The above is the original link.
After watching, I modified a place to be able to access the normal.
1 Location ~ \.php$ {2 root /var/www/web; 3 fastcgi_pass 127.0.0.1:9000; 4 fastcgi_index index.php; 5 fastcgi_param script_filename $document _root$fastcgi_script_name; 6 include fastcgi_params; 7 }
The main is to modify Fastcgi_param this article.
Nginx Configure the virtual domain name directly after the output or download the Web page source code instead of running the Web file solution