1.使用nginx的方法
server {
listen 8168;
server_name localhost;
location / {
root /opt/apache-tomcat-8.5.8/XXX/webapps/ROOT;
index index.html;
try_files $uri $uri/ @router;
index index.html;
# proxy_pass http://192.168.0.35:8167/;
}
location @router {
rewrite ^.*$ /index.html last; }
}
2.tomcat配置方式:
webapps目录下创建WEB-INF,创建web.xml文件。
/webapps/ROOT/WEB-INF# ls -l
total 4
-rw-r–r-- 1 server2 sever2 477 Aug 17 21:01 web.xml
其中web.xml方法里放的内容
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns