Vue路由history模式

在nginx配置中添加

location / {
  try_files $uri $uri/ @router;
  index index.html;
}
location @router {
  rewrite ^.*$ /index.html last;
}
原文地址:https://www.cnblogs.com/xuanjiange/p/14218344.html