码迷,mamicode.com
首页 > 其他好文 > 详细

搭建好lnmp后,使用浏览器访问,出现404 Not Found

时间:2018-06-09 13:18:13      阅读:1389      评论:0      收藏:0      [点我收藏+]

标签:ice   index   /etc   index.php   使用   service   nginx配置文件   原因   /etc/   

出现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

 

搭建好lnmp后,使用浏览器访问,出现404 Not Found

标签:ice   index   /etc   index.php   使用   service   nginx配置文件   原因   /etc/   

原文地址:https://www.cnblogs.com/heyongzhen/p/9158842.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!