單頁面項目打包 使用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

相關文章
相關標籤/搜索