首页 > 技术文章 > 搭建好lnmp后,使用浏览器访问,出现404 Not Found

heyongzhen 2018-06-09 11:04 原文

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

 

推荐阅读