Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have a reverse proxy setup using apache mod_proxy:

<VirtualHost *:443>
   ProxyPass /
   ProxyPassReverse /
   ProxyPreserveHost on
   ...snip ssl stuff...

This works fine most of the time. The problem is when the internal server does a redirect. While the proxypassreverse should catch the location, and it seems to, it redirects to rather than to So it is half working, the address changes correctly, but the protocol stays as the internal server.

I am not clear on why it is doing this, as the proxied connection is SSL - any ideas?

share|improve this question
up vote 4 down vote accepted

ProxyPassReverse can not fix this kind of redirections. There are 2 ways to solve the problem:

  • Use HTTPS for the internal site. e.g. ProxyPass / https:... and ProxyPassReverse / https: (actually the last one is not required in your case).
  • Use mod_headers in the reverse proxy: Header edit Location ^http: https:
  • Use mod_rewrite in the reverse proxy to change the redirection.
share|improve this answer
Ah, so this would send http to the browser, I would need to accept http inbound and change to https? Currently this server is only listening on 443. Is there another way? – Paul May 14 '12 at 22:12
Yes, to use HTTPS internally. – Mircea Vutcovici May 15 '12 at 19:20

I'm just experiencing the same issue. We found 2 ideas to try, dont know if it really works: 1/ use the RequestHeader set X-Forwarded-Protocol "https" =>

2/ use the variable httpsindicatorheader (it's a websphere) to indicate through the application server that the initial request was https. Then every redirection will be on https

share|improve this answer

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.