location ~ .php$ {
fastcgi_pass 0.0.0.0:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
include fastcgi_params;
break;
}
location / {
rewrite ^/ /index.php break;
}
这样设置 访问php页面会直接下载php文件
但是不重定向
location / {
index index.php
}
就能够正常执行php文件,头都大了,不知道为什么。