vue路由history模式刷新404问题解决方案

更改router 的base // biz是二级目录,路由文件改成
const router = new VueRouter({
  mode: 'history',
  // base: process.env.BASE_URL,
  base: '/biz/', // biz是二级目录
  routes
})

下面是nginx配置

server {
        listen       34567;
        server_name  localhost;
        location / {
            index  index.html index.htm;
            try_files $uri $uri/ /biz/index.html;
        }
}
原文地址:https://www.cnblogs.com/lizhao123/p/14174440.html