Apache Reverse proxy Http to https

Posted by Coppes on Server Fault See other posts from Server Fault or by Coppes
Published on 2012-11-10T15:51:36Z Indexed on 2012/11/10 23:01 UTC
Read the original article Hit count: 311

Filed under:
|
|

I have a website which is fully running on Https. For some reason i did get the task to find a way to convert a url for example: http://www.domain.com/a/e-nc/youless to a https version of it, without losing HTTP POST header such as the POST values which are in it.

So i thought (not even sure) let's try to make a reversed proxy in apache and see how that works. Anyway after a lot of struggling i came to the point to ask it here.

So to be speicific my goal is:

Convert the http://www.domain.com/a/e-nc/youless to https://www.domain.com/a/e-nc/youless without losing the POST conditions.

What i have tried until now is the following:

Created a file called: proxiedhosts in my apache2/sites-enabled folder with the following contents:

SSLProxyEngine On
SSLProxyCACertificateFile /etc/apache2/ssl/certificate****.pem

ProxyRequests Off
ProxyPreserveHost On

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

ProxyPass /a/e-nc/youless/ https://www.domain.com/a/e-nc/youless/
ProxyPassReverse /a/e-nc/youless/ https://www.domain.com/a/e-nc/youless/

Thanks in advance!

© Server Fault or respective owner

Related posts about apache2

Related posts about https