Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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>
    ProxyPass / http://localhost:8080/application/
    ProxyPassReverse / http://localhost:8080/application/
    ProxyPreserveHost On

However when I go to it results in an endless loop of http redirects. It also automatically adds the subdirectory to the url. changes in

Does anyone know how to solve this?

share|improve this question

I think you probably want to disable ProxyPreserveHost as it keeps passing the old host, which unless you have a good reason to do so, isn't recommended.

share|improve this answer
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 Jun 17 '13 at 16:25
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 Jun 17 '13 at 16:26
You may also want to use the ProxyPassReverseCookieDomain to ensure the cookies get the right domain in them for your login. – NickW Jun 17 '13 at 16:51
I 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 Jun 17 '13 at 17:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.