知了小站 - IT人的小站 - 解决 Vue 在 History 模式部署在 Nginx 上刷新报 404 的问题 的评论 https://www.ydyno.com/archives/1215.html zh-CN 教程适用于history模式,假设域名假设为:auauz.net原配置server { listen 80; server_name auauz.net; root /www/... Thu, 04 Jun 2020 17:26:19 +0800 Thu, 04 Jun 2020 17:26:19 +0800 知了小站 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-158 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-158 Thu, 04 Jun 2020 17:26:19 +0800 知了小站 怎么说呢,就是看不惯地址栏出现 /#/

]]>
https://www.ydyno.com/archives/1215.html/comment-page-1#comment-158#comments
zxiaozhou https://www.ydyno.com/archives/1215.html/comment-page-1#comment-146 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-146 Tue, 26 May 2020 22:13:16 +0800 zxiaozhou 一般mode: 'history',模式基本用在前后端一起打包,前端请求路径需要后台接口支持的才用。

]]>
https://www.ydyno.com/archives/1215.html/comment-page-1#comment-146#comments
zxiaozhou https://www.ydyno.com/archives/1215.html/comment-page-1#comment-145 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-145 Tue, 26 May 2020 22:11:37 +0800 zxiaozhou 针对刷新404最好的解决方式,避免重新nginx

1.publicPath设置为:./ (使用相对路径)

2.mode: 'history'注释掉,或者改为mode: 'hash'

从此不用配置nginx地址重写,作者启用了非hash路由。整出一大堆问题

]]>
https://www.ydyno.com/archives/1215.html/comment-page-1#comment-145#comments
zxiaozhou https://www.ydyno.com/archives/1215.html/comment-page-1#comment-144 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-144 Tue, 26 May 2020 20:51:02 +0800 zxiaozhou 为啥原始element-admin可以不用修改,原始直接改publicPath为“./",但是你这个却要在nginx搞地址重写,element-admin使用相对路径请求时会自动加上文件夹名称的,即如果放在dist目录下,所有资源路径都会自动加上dist,但是不知道为啥element-admin在你这部署却变得这么麻烦

]]>
https://www.ydyno.com/archives/1215.html/comment-page-1#comment-144#comments
jinxyu https://www.ydyno.com/archives/1215.html/comment-page-1#comment-100 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-100 Mon, 27 Apr 2020 23:04:11 +0800 jinxyu 怎么部署 我连部署都不会

]]>
https://www.ydyno.com/archives/1215.html/comment-page-1#comment-100#comments
且行且叹 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-54 https://www.ydyno.com/archives/1215.html/comment-page-1#comment-54 Fri, 17 Jan 2020 20:57:02 +0800 且行且叹 请问,el-admin 项目部署后,浏览器刷新后报错 : Full authentication is required to access this resource ,所有的页面都是这样。这是啥子原因呢?
谢谢!

]]>
https://www.ydyno.com/archives/1215.html/comment-page-1#comment-54#comments