vue部署跳转问题

比如我的nginx配置是这样

location ^~ /abc/ {
  alias   html/dist/;
  index  index.html index.htm;
  try_files $uri $uri/ /index.html;
}

访问地址是localhost/abc/
然后当我部署上去跳转页面的时候

this.$router.push({
    path: '/home'
})
// or
next('/')

他都会跳转到location,丢失了abc

请问怎么处理呢,对了,history模式

阅读 1.2k
2 个回答

题主试试把
try_files $uri $uri/ /index.html;
加到
location /
不要加在
location ^~ /abc/

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题