出现404 Not Found的原因是nginx指向页面不存在,编辑nginx配置文件,修改nginx指向页面路径

root html; 修改为 root /usr/share/nginx/html;

index index.html index.htm; 修改为 index index.html index.htm index.php;

[root@bogon /]# vim /etc/nginx/nginx.conf
location / {
    root /usr/share/nginx/html;
    index index.html index.htm index.php;
}
[root@bogon nginx]# service nginx restart

 

版权声明:本文为heyongzhen原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/heyongzhen/p/9158842.html