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

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

 

猜你喜欢

转载自www.cnblogs.com/heyongzhen/p/9158842.html