Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 0 down vote accepted

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

<VirtualHost *:443>
    SSLEngine On
    SSLCertificateFile /path/to/cert.pem
    SSLCertificateKeyFile /path/to/cert.key
    ProxyPass / http://localhost:9091/
    ProxyPassReverse / http://localhost:9091/
share|improve this answer
Given that my application uses 'subdirectories' (i.e. localhost:9001/register ) and HTTP POST data, will I have to set up a ProxyPass and ProxyPassReverse line for each subdirectory? – John Oct 16 '12 at 5:58
@John No, this configuration passes all requests (including POST requests). – Shane Madden Oct 16 '12 at 6:05
Thank you for your wisdom, I was able to use this configuration after enabling mod_ssl, mod_proxy, and (the one that eluded me) mod_proxy_http, via sudo a2enmod proxy_http. – John Oct 16 '12 at 6:13

Your Answer


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.