httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daan van de Linde <>
Subject [users@httpd] apache2 proxy combination with rewrite for adjusting a url
Date Tue, 02 Sep 2003 13:22:02 GMT

Im attempting to setup a reverse proxy on apache2 with rewrite support in 
the hope
of solving the following problem (of which even after reading tons mailing 
isnt answered):

<< Internet >>-----------<< Reverse Proxy >>------------<< Webserver
    +---------------------<< auth server >>

What it should do:
Every client connects to and receives the website hosted
on This loads the authentication page on
Once authenticated, the client should go back to the webserver, and the 
client can access its files.
Except the authentication (on everything must pass through 
the proxy.

What Ive figured out so far:
In this URL
the internal name of the webserver is displayed. The 
"TARGET=" must
be replaced with "TARGET=", as the client will go to 

The problem:
obviously, it doesnt work, the proxy'ing works, but the rewriting of the 
URL does not.
The configuration below should give an idea in what general direction Im 
attempting to go.
ive read through the maillinglist archives / the FAQ and all google 
results I could find,
but I havent found anything that works for this cause.

All idea's/comments (having to switch to apache 1.3 for a working solution 
is no problem)
are welcome.


Daan van de Linde

The configuration:
<IfModule mod_proxy.c>
          ProxyRequests off
          ProxyPass /
          ProxyPassReverse /

RewriteEngine on
RewriteLogLevel 9
RewriteLog /var/log/rewrite.log
RewriteMap server txt:/usr/local/etc/apache2/apache.servers
<Directory />
     Options FollowSymLinks
     AllowOverride None
     RewriteRule    ^/rproxy-status.*     -   [L]
     RewriteRule    ^(http|ftp)://.*      -   [F]
     RewriteRule    ^/(.*\.(cgi|shtml))$  to://${server:dynamic}/$1  [S=1,R]
     RewriteRule    ^/(.*)$               to://${server:static}/$1 [R]
     RewriteRule    ^to://([^/]+)/(.*)    http://$1/$2   [E=SERVER:$1,P,L,R]
     RewriteRule    .*                    -              [F]




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