在nginx.conf文件中配置以下代码
server {
listen 80;
server_name www.domain.com;
location ~ \.php$ {
root /opt/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location / {
root /opt/www;
index index.php;
}
}
重启nginx
service nginx restart