SSL Proxy: Forwarding without the encryption

apache-2.2PROXYreverse-proxyssl

I have a python application listening on port 9001 for HTTP traffic.

I'm trying to configure Apache (or anything, really) to listen on port 443 for HTTPS connections, and then forward the connection, sans encryption, to port 9001 on the same machine. My application would then reply via the proxy, where the encryption would be reapplied, and returned to the client transparently.

I'm not doing anything crazy with the site names and SSL certs, I have one public IP, one hostname, and one SSL cert. Stripping the encryption at the proxy doesn't seem to be a common requirement.

Is what I'm asking for a normal requirement? Are there other concerns with this sort of configuration?

Best Answer

Pretty simple, really. You want a virtual host with encryption, then a proxy to a non-encrypted HTTP endpoint.

<VirtualHost *:443>
    ServerName www.example.com
    SSLEngine On
    SSLCertificateFile /path/to/cert.pem
    SSLCertificateKeyFile /path/to/cert.key
    ProxyPass / http://localhost:9091/
    ProxyPassReverse / http://localhost:9091/
</VirtualHost>