vue项目发布后带路径打开页面报404问题

环境:

后端,python+uwsgi启动

前端:vue  用nginx运行,指定静态目录

问题 :发布后带路径打开页面报404问题,带路径打开即不是打开的主页

解决方案:

https://router.vuejs.org/zh/guide/essentials/history-mode.html#%E5%90%8E%E7%AB%AF%E9%85%8D%E7%BD%AE%E4%BE%8B%E5%AD%90

nginx配置加上

location / {
    try_files $uri $uri/ /index.html;
}

原文地址:https://www.cnblogs.com/cherylgi/p/13392382.html