修改三个配置,具体操作日后有时间更新,不懂私聊
1
const route = new Router({
mode: 'history',
base: '/doctor-html/',
routes
})
2
assetsPublicPath: '/doctor-html/',
3
try_files $uri $uri/ /doctor-html/index.html;
4
项目目录配置实例
项目路径web/doctor-html/index.html
nginx配置root指向 web/ 项目放在doctor-html,但是nginx指向web,url访问com/doctor-html就好了
本文介绍如何在Nginx服务器中正确配置Vue.js项目的路由,确保SPA应用的正常运行。通过修改三个关键配置项:路由模式、静态资源路径及Nginx的try_files指令,实现对Vue项目的优化部署。

825

被折叠的 条评论
为什么被折叠?



