上军哥的网站搞了配置如下:

  • location /test {
  • alias /home/wwwroot/test/;
  • index index.html index.php;
  • }
  • - location ~ /test/.+\.php$ {
  • rewrite /test/(.+\.php) /$1 break;
  • fastcgi_pass unix:/tmp/php-cgi.sock;
  • fastcgi_index index.php;
  • fastcgi_param SCRIPT_FILENAME /home/wwwroot/test/$fastcgi_script_name;
  • include fastcgi_params;
  • }复制代码

然后并不可以用,解析html都行,然而php就是运行不了 提示 No input file specified.