I'm using Apache HTTPD to proxy a local Tomcat server:

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

Everything works fine except when I have a 302 redirect. For some reason the ProxyPassReverse doesn't rewrite the localhost:8080 and the client gets redirected to localhost:8080 which causes a browser error.

How can I get ProxyPassReverse to work with 302 redirects?

1 Answer 1


I needed to add:

ProxyPreserveHost On

This resolved the issue.

  • Hi, can you share your conf? I'm facing the same issue, and the ProxyPreserveHost has not solved it. Thanks
    – Sourcerer
    Aug 8, 2021 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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