Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have HTTPS test server with a self-signed SSL certificate. Is there any reverse proxy that will enable us to visit the page in HTTP, so our program can send HTTP request and not an HTTPS request??

share|improve this question

3 Answers 3

up vote 5 down vote accepted

You can do it with apache.

First, you need to load the proxy, proxy_http and proxy_html modules.

Then you need a certificate and a key for the proxy (a self-signed certificate will do). Put these together into a .pem file (so that the file will contain both the key and the certificate). It is needed only to initiate an SSL connection to the test server.

Then, you need a proxy setting like this:

<VirtualHost 0.0.0.0:80>
    ServerName give_it_a_name

    SSLProxyEngine on
    SSLProxyCACertificateFile /the/path/to/your/pem/file.pem

    ProxyPass / https://your-test-server/
    ProxyPassReverse / https://your-test-server/

    ErrorLog /the/error.log
</VirtualHost>

Of course you don't need a VirtualHost for this, you can embed the ProxyPass* and the SSLProxy* directives to any other host definition.

share|improve this answer

If your test server has HTTP enabled you can simply proxy to that protocol (assuming apache and mod_rewrite):

RewriteEngine On
RewriteRule ^/foo(.*)$ http://testserver.example.org/$1 [P]

If there's nothing listening on the unencrypted HTTP port you can't just strip the SSL away.

share|improve this answer
RewriteEngine On
RewriteRule ^/foo(.*)$  https://%{HTTP_HOST}%{REQUEST_URI} [R]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.