比如我的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模式
题主试试把
try_files $uri $uri/ /index.html;
加到
location /
不要加在
location ^~ /abc/