I have two equal web app instances in Tomcat which are made available by Apache's Reverse Proxy. The first one works just fine but the second one has a problem with getting data from the session (null pointer exception). The ProxyPassReverseCookiePath is apparently configured wrong.
Here is my configuration:
<IfModule proxy_module>
<IfModule proxy_http_module>
#
# Reverse Proxy
#
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /app1/ http://localhost:8080/localapp1/
ProxyPassReverse /app1/ http://localhost:8080/localapp1/
ProxyPassReverseCookiePath /localapp1 /app1/
ProxyPass /app2 http://localhost:8080/app2
ProxyPassReverse /localapp2 http://localhost:8080/app2
ProxyPassReverseCookiePath /app2 /app2
<Location /app1/ >
RequestHeader edit X-GWT-Module-Base ^(.*)/app1/(.*)$ $1/localapp1/$2
</Location>
<Location /app2 >
RequestHeader edit X-GWT-Module-Base ^(.*)/app2(.*)$ $1/app2$2
</Location>
</IfModule>
</IfModule>
I wanted for the second one to be accesible without the need of a slash ("/") at the end of the URL. I really can't figure out what is wrong here, hope someone can help.
Is the following configuration what you really want?
ProxyPass /app2 http://localhost:8080/app2
ProxyPassReverse /localapp2 http://localhost:8080/app2
ProxyPassReverseCookiePath /app2 /app2
The proxyPass and ProxyPassReverse configurations don't match. Based on localapp1, your back-end path should probably be localapp2. The following makes more sense to me at an initial glance:
ProxyPass /app2 http://localhost:8080/localapp2
ProxyPassReverse /app2 http://localhost:8080/localapp2
ProxyPassReverseCookiePath /localapp2 /app2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With