httpd-users mailing list archives

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

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 
archives
isnt answered):

Problem
=======
Setup:
<< Internet >>-----------<< Reverse Proxy >>------------<< Webserver
>>
    |                     proxy.dom.com                  intern.dom.com
    |                     1.2.3.4                        3.4.5.6
    +---------------------<< auth server >>
                          login.dom.com
                          6.7.8.9

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

What Ive figured out so far:
In this URL 
https://login.dom.com/login.blah?Session=000-0dad00000dad&TARGET=https://intern.dom.com/
the internal name of the webserver is displayed. The 
"TARGET=https://intern.dom.com/" must
be replaced with "TARGET=https://proxy.dom.com/", as the client will go to 
TARGET.

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.

Greetings,

Daan van de Linde


The configuration:
httpd.conf:
<<snip>>
<IfModule mod_proxy.c>
          ProxyRequests off
          ProxyPass / http://proxy.dom.com
          ProxyPassReverse / http://proxy.dom.com
</IfModule>

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]
</Directory>

apache.servers:
dynamic intern.dom.com
static intern.dom.com

=====
The



  

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message