知了小站 - IT人的小站 - 解决 Vue 在 History 模式部署在 Nginx 上刷新报 404 的问题 的评论 https://www.ydyno.com/archives/1215.html 教程适用于history模式,假设域名假设为:auauz.net原配置server { listen 80; server_name auauz.net; root /www/... 知了小站 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-158 2020-06-04T17:26:19+08:00 怎么说呢,就是看不惯地址栏出现 /#/ zxiaozhou https://www.ydyno.com/archives/1215.html/comment-page-1#comment-146 2020-05-26T22:13:16+08:00 一般mode: 'history',模式基本用在前后端一起打包,前端请求路径需要后台接口支持的才用。 zxiaozhou https://www.ydyno.com/archives/1215.html/comment-page-1#comment-145 2020-05-26T22:11:37+08:00 针对刷新404最好的解决方式,避免重新nginx1.publicPath设置为:./ (使用相对路径)2.mode: 'history'注释掉,或者改为mode: 'hash'从此不用配置nginx地址重写,作者启用了非hash路由。整出一大堆问题 zxiaozhou https://www.ydyno.com/archives/1215.html/comment-page-1#comment-144 2020-05-26T20:51:02+08:00 为啥原始element-admin可以不用修改,原始直接改publicPath为“./",但是你这个却要在nginx搞地址重写,element-admin使用相对路径请求时会自动加上文件夹名称的,即如果放在dist目录下,所有资源路径都会自动加上dist,但是不知道为啥element-admin在你这部署却变得这么麻烦 jinxyu https://www.ydyno.com/archives/1215.html/comment-page-1#comment-100 2020-04-27T23:04:11+08:00 怎么部署 我连部署都不会 且行且叹 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-54 2020-01-17T20:57:02+08:00 请问,el-admin 项目部署后,浏览器刷新后报错 : Full authentication is required to access this resource ,所有的页面都是这样。这是啥子原因呢?谢谢!