1.编辑 nginx.conf
2.location/{
root /usr/local/nginx/html
}
将 root /usr/local/nginx/html 放到上一级 server下解决问题
3.贴上我的 nginx.conf文件
server {
listen 80;
server_name www.姚虎.top;
root /XXXX/html;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
#root html;
index index.html index.htm index.php;
}
推荐博文 https://blog.csdn.net/rofth/article/details/78581617