nginx配置
location / {
proxy_pass http://localhost:8082/demo/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header From $host;
proxy_cookie_path ~*^/.* /;
proxy_set_header Cookie $http_cookie;
}
apache配置,以下为修改部分,并不是最终部分
<VirtualHost *:80>
ProxyPass / http://localhost:8082/demo/
ProxyPassReverse / http://localhost:8083/demo/
ProxyPreserveHost On
ProxyPassReverseCookieDomain locahost $host
ProxyPassReverseCookiePath /demo /
<Directory "/www/server/tomcat9/webapps">
#SetOutputFilter DEFLATE
#Options FollowSymLinks
#AllowOverride All
#Require all granted
#DirectoryIndex index.php index.html index.htm default.php default.html default.htm
AllowOverride none
Require all granted
Header set Access-Control-Allow-Origin *
</Directory>
</VirtualHost>