1. 程式人生 > >搭建好lnmp後,使用瀏覽器訪問,出現404 Not Found

搭建好lnmp後,使用瀏覽器訪問,出現404 Not Found

highlight 存在 dex htm service 修改 start not found ice

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