vue部署在nginx後刷新404,nginx.conf一行代碼解決掉

直接 vim conf/nginx.conf文件

server {
        listen       8081;
        server_name  localhost;

#charset koi8-r;

#access_log  logs/host.access.log  main;

location / {
            root   /home/www;
            index  index.html index.htm;
            try_files $uri $uri/ /index.html;
    
        }

然後esc 退出 wq! 進行保存

關閉 ..../nginx -s stop

重啓 .../nginx

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章