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
}

 

相关文章:

  • 2021-12-09
  • 2022-02-01
  • 2022-12-23
  • 2021-09-19
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-11-24
猜你喜欢
  • 2021-07-29
  • 2021-04-01
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2021-08-12
  • 2022-12-23
相关资源
相似解决方案