Sunday, May 15, 2005

Proxying HTTP and HTTPS with Apache

Sorry if this info is a bit rough. It still needs to be more thoroughly tested, but here's what I've done to make my Apache 2.0 web server be a proxy server for HTTP and HTTPS.

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule ssl_module modules/mod_ssl.so


        ProxyRequests On
#specify a list of port numbers to which the proxy CONNECT method may connect
#allow 22 to use PuTTY w/Proxy to connect to arbitrary SSH over HTTP proxy.
        AllowCONNECT 80 443 22

#secure your proxy server with Basic auth.
        
                AuthType Basic
                AuthName "my proxy server"
                AuthUserFile /path/to/file/.htpasswd-proxy
                Require valid-user
        

#Mask your point of origination
        ProxyVia Block
        CustomLog logs/proxy_log common



#allow SSL proxying to occur on port 80
        SSLProxyEngine On
        SSLProxyVerify none

No comments: