Apache ProxyPassReverse and https

Posted by joshuaball on Server Fault See other posts from Server Fault or by joshuaball
Published on 2009-06-29T04:33:22Z Indexed on 2010/04/12 21:23 UTC
Read the original article Hit count: 514

Filed under:
|
|

Hi, I would like to map all traffic on 80 and 443 from foo.com to an internal server: 192.168.1.101. I have a VirtualHost (Apache 2.2 on Ubuntu) setup as follows (note, I had to break up the hyperlinks below because I am a 'new user'):

<VirtualHost *:80>
  ServerName foo.com
  ServerAlias *.foo.com
  ProxyRequests Off
  ProxyPreserveHost On

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPass / http://192.168.1.101/
  ProxyPassReverse / http://192.168.1.101/
</VirtualHost>

And that works great for http traffic. However, I can't seem to do the same thing for https. I have tried:

  • Changing VirtualHost *:80 to * - but that doesn't work (I need it http->http and https->https)

  • Creating a new VirtualHost entry for *:443 that redirects to http://192.168.1.101/, but that fails as well (browser timeouts)

I did some searching, here and elsewhere, and the closest question I could find was this, but that didn't quite answer it.

Also, just out of curiosity, I tried mapping all ports to https (by changing the two ProxyPass lines from http to https (and removing the :80 from VH), and that didn't work either. How would you do that as well?

Any thoughts? Thanks in advance.

© Server Fault or respective owner

Related posts about apache2

Related posts about https