ProxyPass entire domain to Tomcat, including root
I have configured my VirtualHost
example.com to proxy all requests to a Tomcat server
ProxyPass / http://localhost:8088/app
ProxyPassReverse / http://localhost:8088/app
This works fine for URLs like example.com/page, but for example.com and example.com/ I get this redirection response, which obviously leads to nothing.
HTTP/1.1 302 Moved Temporarily
Date: Wed, 06 Jul 2011 21:13:37 GMT
Server: Apache-Coyote/1.1 <-- the redirect comes from tomcat
Location: http://example.com/app/ <-- nonsense
...
What can I do to fix it? Preferably in the Apache config.
I'm using Apache 2 and Tomcat 7
I'm not exactly sure why, but this is the fix
ProxyPass / http://localhost:8088/app/
ProxyPassReverse / http://localhost:8088/app/
(Added slashes to the end)