[BangPypers] How to create HTTPS Proxy server

steve steve at lonetwin.net
Sun Oct 9 09:34:08 CEST 2011


Hi,

On 10/07/2011 06:31 PM, deepak gupta wrote:
> Hi All,
>
> Do any one know , how to create reverse proxy server over HTTPS?
>
> We want to create one HTTPS proxy server:
>
> 1. Proxy server (192.168.1.1) : HTTPS port (8000) binding on this server and
> user will access this server and browse some url's.for ex
> https://192.168.1.1:8000/xyz

> 2. This (proxy) server 192.168.1.1 will talk to another web server actual
> backend server (192.168.1.2: 8000) over HTTP/HTTPS . HTTPS proxy server will
> forward the request to the backend server and get back the response and then
> return to client browser.
>
> We have created but it is hanging and sometime not returning full data.If
> anyone knows any stable proxy server over HTTPS then please let me know.
>

Could you give some more details ? Like, OS, webserver, and app. server you are 
using ? I recently had to do this using Apache with mod_wsgi on Linux and it 
turned out easier than I assumed initially.

If yours is a similar setup, it basically boils down to just these few 
directives on your proxy:

# Setup SSL
SSLEngine On
SSLCertificateFile /path/to/your/ssl/cert
SSLCertificateKeyFile /path/to/the/private/key

# Turn on Proxying for SSL
SSLProxyEngine On

# Prevent Apache from acting like a forward proxy
ProxyRequests Off

# Map proxy URLs to backend server URL
ProxyPass / https://192.168.1.1:800/

# Ensure that responses from the backend server have correct
# headers when being returned
ProxyPassReverse / https://192.168.1.1:8000/


Note:

a. I've assumed here that you know how to enable and load modules and do the 
rest of the virthost setup. One non-intuitive thing is you'd have to enable both 
mod_proxy and mod_prox_http to make this work.

b. The same can also be achieved with RewriteRules, which is terser and more 
flexible (for example, conditional proxying), explaining that tho' would take 
more time so please send details first.

cheers,
- steve

-- 
random spiel: http://lonetwin.net/
what i'm stumbling into: http://lonetwin.stumbleupon.com/


More information about the BangPypers mailing list