单页面项目打包 使用router 在服务器中 刷新页面404

1 tomcat html

在根目录建立文件夹WEB-INF 建立web.xml java

clipboard.png

<?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">nginx

<error-page> <error-code>404</error-code> <location>/index.html</location>
</error-page>

</web-app>web

2 nginx tomcat

修改服务器conf下的 nginx.conf 文件服务器

clipboard.png

项目目录app

clipboard.png

相关文章
相关标签/搜索