httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Bishop" <>
Subject [users@httpd] Help with CONNECT method rewriting
Date Tue, 03 Aug 2010 21:35:24 GMT


I'm hoping you can help me with something that I've been struggling with
for a couple of days.

I'm using mod_proxy to forward proxy requests between one network and
another.  I'm attempting to combine this with mod_rewrite to rewrite
CONNECT requests for certain (SSL) servers.  Note that I'm only trying to
rewrite the HTTP connect request, not the SSL data itself (which is
encrypted and I have no access to).

What I'm hoping to achieve is that "CONNECT
HTTP/1.0" gets rewritten to "CONNECT HTTP/1.0" - an
upstream proxy then gets the request "CONNECT
HTTP/1.0".  Having played around with mod_rewrite for several hours I'm
having trouble getting it working.

I've enabled RewriteLogLevel 9 and I'm seeing log entries that indicate
things are working as I intend:

rewrite '' -> ''

Though the upstream proxy is still seeing "CONNECT"
rather than the rewritten version.

The relevant parts of my httpd.conf file are:

LoadModule headers_module modules/
LoadModule rewrite_module modules/
LoadModule proxy_module modules/
LoadModule proxy_connect_module modules/
LoadModule proxy_http_module modules/

ProxyRequests On
ProxyVia On
AllowConnect 443

<Proxy *>
        Order allow,deny
        Allow from all

RewriteEngine On
RewriteRule ^(.*)server\.example\.org(.*)$ $$2

I've noted that mod_rewrite has a [P] flag that forces the request to be
proxied to another server, though this doesn't appear to work with https
(SSL) servers - or am I missing something?

Any advice would be gratefully received.

Many thanks


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message