单页面项目打包 使用router 在服务器中 刷新页面404
文章目录
1 tomcat
在根目录创建文件夹WEB-INF 创建web.xml

<?xml version="1.0" encoding="UTF-8"?> <web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001
/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/j...d" version="3.1" metadata-
complete="true">
<error-page> <error-code>404</error-code> <location>/index.html</location>
</error-page>
</web-app>
2 nginx
修改服务器conf下的 nginx.conf 文件

项目目录


评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论