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

原文地址:https://www.cnblogs.com/angelasp/p/13026377.html