Apache ProxyPass with SSL

Posted by BBonifield on Server Fault See other posts from Server Fault or by BBonifield
Published on 2011-02-22T15:00:07Z Indexed on 2011/02/22 15:26 UTC
Read the original article Hit count: 400

Filed under:
|
|
|
|

I have a QA setup that consists of multiple internal development servers and one world-accessible provisioning machine that is setup to proxy pass the web traffic. Everything works fine for non-SSL requests, but I'm having a hard time getting the SSL logic working as well. Here's a few example vhost blocks.

<VirtualHost 192.168.168.101:443>
    ProxyPreserveHost On
    SSLProxyEngine On
    ProxyPass / https://192.168.168.111/
    ServerName dev1.site.com
</VirtualHost>

<VirtualHost 192.168.168.101:80>
    ProxyPreserveHost On
    ProxyPass / http://192.168.168.111/
    ServerName dev1.site.com
</VirtualHost>


<VirtualHost 192.168.168.101:443>
    ProxyPreserveHost On
    SSLProxyEngine On
    ProxyPass / https://192.168.168.111/
    ServerName dev2.site.com
</VirtualHost>

<VirtualHost 192.168.168.101:80>
    ProxyPreserveHost On
    ProxyPass / http://192.168.168.111/
    ServerName dev2.site.com
</VirtualHost>

I end up seeing the following error in the provisioner's error log.

[Fri Jan 28 12:50:59 2011] [warn] [client 1.2.3.4] proxy: no HTTP 0.9 request (with no host line) on incoming request and preserve host set forcing hostname to be dev1.site.com for uri /

As well as the following entry in the destination QA machine's access log.

192.168.168.101 - - [22/Feb/2011:08:34:56 -0600] "\x16\x03\x01 / HTTP/1.1" 301 326 "-" "-"

© Server Fault or respective owner

Related posts about apache

Related posts about ssl