【发布时间】:2012-01-18 16:48:22
【问题描述】:
坚持将 apache 配置为在不同 PC 上运行在 tomcat 上的应用程序的代理。一切似乎都在第一个应用程序 - WebApp1 上运行。但是左侧的 ProxyPassReverseCookiePath 不起作用。 ProxyPassReverseCookiePath 仅适用于第一个应用程序。访问其他应用程序时,会将 jsessionid 添加到 url。 我错过了什么以及如何修复 WebApp2 和 WebApp3?谢谢
httpd-vhosts.con:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ProxyRequests off
ProxyPreserveHost on
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /WebApp1/ ajp://192.168.1.98:8009/WebApp1/
ProxyPassReverse /WebApp1/ ajp://192.168.1.98:8009/WebApp1/
ProxyPassReverse /WebApp1/ http://192.168.1.98:8080/WebApp1/
ProxyPassReverseCookiePath /WebApp1 /WebApp1/
ProxyPass /WebApp2/ ajp://192.168.1.98:8009/WebApp2/
ProxyPassReverse /WebApp2/ ajp://192.168.1.98:8009/WebApp2/
ProxyPassReverse /WebApp2/ http://192.168.1.98:8080/WebApp2/
ProxyPassReverseCookiePath /WebApp2 /WebApp2/
ProxyPass /WebApp3/ ajp://192.168.1.98:8009/WebApp3/
ProxyPassReverse /WebApp3/ ajp://192.168.1.98:8009/WebApp3/
ProxyPassReverse /WebApp3/ http://192.168.1.98:8080/WebApp3/
ProxyPassReverseCookiePath /WebApp3 /WebApp3/
</VirtualHost>
【问题讨论】:
标签: apache tomcat cookies proxy reverse-proxy