vue-cli3项目路由history模式部署到linux
1.项目修改vue.config.js增加publicPath: '/'2.nginx配置location / {#访问前端页面root /data/dist;#vue项目存放路径indexindex.html; #hash模式只配置访问html就可以了try_files $uri $uri/ /index.html;#history模式配置否则会出现vue的路由在nginx中刷新出现404}..
·
1.项目修改
vue.config.js增加
publicPath: '/'
2.nginx配置
location / {#访问前端页面
root /data/dist;#vue项目存放路径
index index.html; #hash模式只配置访问html就可以了
try_files $uri $uri/ /index.html;#history模式配置否则会出现vue的路由在nginx中刷新出现404
}
更多推荐
已为社区贡献1条内容
所有评论(0)