vue 在nginx上面出现刷新后404错误

 解决办法:

在nginx的配置文件中添加

 location / {
        root   /usr/share/nginx/html/;
        index  index.html index.htm;
        try_files $uri $uri/ @router;
        index index.html;
    }
    location @router {
        rewrite ^.*$ /index.html last;
        }

主要是try_files这个

猜你喜欢

转载自blog.csdn.net/liaoxiaolin520/article/details/83062248