可以试着更改match条件为对于所有php档pass到fastcgi:如下:location ~ .*.php$ {fastcgi_pass 127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME $document_root$fastcg\i_script_name;include fastcgi_params; }先看看php跑的对不对再来debug你的document_root设定另外一种可能的解法是设定link:sudo ln -sv /var/work/php /var/work/nginx_rootls -la /var/work/nginx_root/phpAccess URL:
http://localhost/php/test.php