title: Redirect http to https using apache mod_proxy
body: <hr>
  
  <h2><strong>Setup</strong></h2>
  
  <p>appserver   ----> webserver   ----> (3rd party endpoint)<br/></p>
  
  <blockquote>
  <pre><code>      8080              (https://www.b2b.com:1100/...)&lt;br/&gt;
       [http]      [https]  
  </code></pre>
  </blockquote>
  
  <hr>
  
  <h2><strong>Error Logs</strong></h2>
  
  <p>[Mon Nov 19 17:18:23 2012] [warn] Proxy client certificate callback: (box1:80) downstream server wanted client certificate but none are configured
  [Mon Nov 19 17:18:23 2012] [error] (502)Unknown error 502: proxy: pass request body failed to :1100 (www.b2b.com)
  [Mon Nov 19 17:18:23 2012] [error] proxy: pass request body failed to :1100 (www.b2b.com) from box1()</p>
  
  <hr>
  
  <h2><strong>Issue</strong></h2>
  
  <p>The 3rd party upgraded their env and provided revised certs (rootCA, intermediateCert, serverCert)</p>
  
  <p>The older implementation had only one self signed cert.
  We had used mod_proxy to redirect http to https.
  Used virtualhost and used SSLProxyEngine config the cert and it was working fine</p>
  
  <p>After the upgrade of the 3rd party, the existing configuration no longer works and we receive a http-502 error</p>
  
  <p>Any pointers on configs that needs to be included on apache side?</p>
  
  <hr>
  
  <h2><strong>Old Configuration</strong></h2>
  
  <p>LoadModule rewrite_module modules/mod_rewrite.so
  LoadModule ssl_module modules/mod_ssl.so</p>
  
  <pre><code>&lt;VirtualHost [ip]:8080&gt;
  ServerName hostname.com
  SSLProxyEngine On
  SSLCertificateFile "conf/ssl.crt/server.crt"
  #SSLProxyCheckPeerCN on
  #SSLProxyCheckExpire on
  ProxyPass           /outboundservice/b2b/ https://www.b2b.com/webservice/7/
  ProxyPassReverse    /outboundservice/b2b/ https://www.b2b.com/webservice/7/
  </code></pre>
  
  <h2>    </h2>
  
  <h2><strong>New Configuration</strong></h2>
  
  <pre><code>&lt;VirtualHost [ip]:8080&gt;
  ServerName hostname.com
  SSLProxyEngine On
  SSLCertificateFile "conf/ssl.crt/cons_v8.cer"
  SSLCertificateKeyFile "conf/ssl.crt/server.key.pem"
  #SSLProxyCheckPeerCN off
  #SSLOptions +ExportCertData
  #SSLProxyVerify Optional
  LogLevel debug
  ProxyPreserveHost On
  ProxyPass           /outboundservice/b2b/ https://www.b2b.com/webservice/8/
  ProxyPassReverse    /outboundservice/b2b/ https://www.b2b.com/webservice/8/
  &lt;/VirtualHost&gt;    
  </code></pre>
  
  <p>Thanks
  -R</p>