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 seen different flavors of this but nothing that clearly matches what I need to do. I have an Apache server with a wildcard cert installed. Now I want Apache to do two things:

1) Listen for requests on http and permanently request https for each site. 2) Proxy that https request to internal servers who are listening only on port 80.

I am pretty sure that I will have multiple virtual host entries and lets assume that the CNames are,, All of them point to the same IP which is my Apache server.

So when a request comes in for it should be redirected to and then proxied to an internal server at A request for should be redirected to and proxied back to so on.

As best I can guess the virtual hosts for should be something like:

NameVirtualHost *:80

<VirtualHost *:80>
Redirect permanent / ``

<VirtualHost *:443>
ProxyPass / ``
ProxyPassReverse / ``

I am uncertain as to whether this is the correct approach (I have seen some examples using rewrites) and I am not certain that I need TWO virtual host entries per domain.

Can someone verify that this is the correct approach? This Apache will be the reverse proxy for multiple hosts at this domain.

share|improve this question

You have the correct setup for what you are trying to do.

Those slanted dashes around the URLs can be removed.

share|improve this answer
Thanks. The slanted dashes were there to escape the ip addresses for posting here (guess I did it wrong). – Pete Helgren Nov 22 '12 at 2:44

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.