title: Proxying with SSL
body: <p>I have a Linux host running Apache and a Windows host running IIS.  I have a domain that points to the Linux host and need to relay (proxy) requests for it to IIS; I thus have the following virtual host definition in Apache (which works just fine):</p>
  
  <pre><code>&lt;VirtualHost 192.168.0.2:80&gt;
      ServerName www.acme.com
      DocumentRoot /var/www/acme.com
  
      RewriteEngine On
      RewriteOptions Inherit
      RewriteRule ^/(.*) http://win.acme.com/$1 [P]
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>now I want to add SSL support; the definition becomes:</p>
  
  <pre><code>&lt;VirtualHost 192.168.0.2:443&gt;
      ServerName www.acme.com
      DocumentRoot /var/www/acme.com
      GnuTLSEnable On
      GnuTLSPriorities NORMAL:%COMPAT
      GnuTLSCertificateFile /var/www/ssl/www.acme.com.crt
      GnuTLSKeyFile /var/www/ssl/www.acme.com.key
  
      RewriteEngine On
      RewriteOptions Inherit
      RewriteRule ^/(.*) https://win.acme.com/$1 [P]
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>I have valid and trusted certificates on both web servers and if I visit <code>https://win.acme.com</code> all is well, however, when I visit <code>https://www.acme.com</code> I get a 500 Internal Server Error message.  A peek at the error logs shows:</p>
  
  <blockquote>
    <p>[Wed Jul 20 08:35:34 2011] [error] [client 76.168.166.70] SSL Proxy
    requested for www.wileybits.com:80 but not enabled [Hint:
    SSLProxyEngine] [Wed Jul 20 08:35:34 2011] [error] proxy: HTTPS:
    failed to enable ssl support for 74.166.186.70:443 (win.acme.com)</p>
  </blockquote>
  
  <p>do notice that the proxy request seems to be for the wrong domain (wileybits)... the domain it shows is also hosted by my Apache server but I don't get why it shows up in the logs of acme.com (a reverse DNS lookup perhaps?)</p>
  
  <p>in any case, what am I missing?</p>
  
  <p>thanks in advance - ekkis</p>
  
  <p>p.s. host names and addresses have been altered to protect the innocent :)</p>
  
  <p><strong>* update *</strong></p>
  
  <p>with:</p>
  
  <pre><code>RewriteRule ^/(.*) https://win.acme.com/$1 [R,L]
  </code></pre>
  
  <p>it seems to work fine, but of course, the Windows' hostname becomes visible, which is not acceptable in my scenario</p>
  
  <p>I also tried (instead of mod_rewrite):</p>
  
  <pre><code>ProxyRequests Off
  ProxyPass / https://win.acme.com/
  </code></pre>
  
  <p>but same error</p>