正确配置PHP连接:
nginx.conf 增加以下配置。其实这个类似配置在 nginx.conf 已经存在(被注释),可以参考。
server {
listen 80;
server_name cannedbread.com; # 域名
root /opt/www; # 网站的根目录
location / {
index index.html index.htm index.php; # 域名下默认访问文件
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
}
运行配置附件
0