2
I'm trying to setup Apache as a reverse proxy for a domain-name. It should redirect to an application running on a Apache Tomcat server
i'm using the following configuration:
<VirtualHost *:80>
ServerName sub.domain.com
ProxyPass / http://localhost:8080/application/
ProxyPassReverse / http://localhost:8080/application/
ProxyPreserveHost On
</VirtualHost>
However when I go to http://sub.domain.com it results in an endless loop of http redirects. It also automatically adds the subdirectory to the url. http://sub.domain.com changes in http://sub.domain.com/application/
Does anyone know how to solve this?
When i disable ProxyPreserveHost something causes the application to only show me the login page. No matter what address I visit it always shows the login page. This could be an error in the application. – Ozzie – 2013-06-17T16:25:16.563
That it could be... the other thing I was going to recommend is putting a line like this:
ProxyPass http://localhost:8080/ !
to see if stopping the redirect when you actually get to the page helps.. – NickW – 2013-06-17T16:26:51.540You may also want to use the
ProxyPassReverseCookieDomain
to ensure the cookies get the right domain in them for your login. – NickW – 2013-06-17T16:51:37.487I fixed it by just deploying my application in tomcat's root so i don't have the issues with the subdirectories. But thanks for the help! – Ozzie – 2013-06-17T17:32:37.900