httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean O'Neill <s...@seanoneill.info>
Subject [users@httpd] Problem with Rev Proxy config and mod_rewrite
Date Thu, 06 Mar 2003 05:58:44 GMT
Using Apache 2.0.44 for this exercise.

This is what I have:

- I have a FreeBSD machine behind a firewall on a nonroutable network 
running Subversion on Apache.  To get to this subversion repository on this 
machine directly (while on the same subnet), you hit 
"http://compaq.nonroutable.com/repos".  You'll get back a simply list of 
one document (a README file) and 3 directories which are all links.

- On the firewall I have Apache 2.0.44 running - just assume its 
www.firewall.com for this discussion.  I've got the following config for 
the Reverse Proxy setup:

RewriteRule ^/repos/?$ http://compaq.nonroutable.com/repos/ [NC,P]
RewriteRule ^/repos/(.*/)$ http://compaq.nonroutable.com/repos/$1 [NC,P]
RewriteRule ^/repos/(.*[^/])$ http://compaq.nonroutable.com/repos/$1/ [NC,P]
ProxyPassReverse /repos http://compaq.nonroutable.com

The RewriteRule lines always make sure the proxied URL references always 
end in a / character.  I'm not regexp expert but this seems to work fine at 
least while watching the rewrite_log file they seem to do what I want them 
to.  Anyone wanting to educate me on a better way of doing things is 
welcome to advise me :)

I'm not sure about the ProxyPassReverse config setting.  I've also tried 
"ProxyPassReverse / http://compaq.nonroutable.com" but I get the same 
results.  The above config KINDA works.

What happens is when you hit "http://www.firewall.com/repos", you will get 
the  initial page of the subversion repository on the FreeBSD machine just 
fine.  On this page are the one document, a README file, and 3 links to 
other directory structures in this repository.  This is where the problems 
begin.

- According to the returned web page source via either the reverse proxy 
config OR hitting the page directly on the compaq.nonroutable.com server, 
the link to the README file is simply "<a href="README">README</a>".

- When hitting this page via the reverse proxy config and clicking on the 
README document URL link, the link is resolved as 
"http://www.firewall.com/README".  This doesn't work because the "/repos" 
portion of the URL is missing.

- When hitting this page directory e.g. 
http://compaq.nonroutable.com/repos, and clicking on the README document 
URL link, the README link is resolved as 
"http://compaq.nonroutable.com/repos/README" and works just dandy.

So my question is why the difference in how the URL is fully qualified from 
the "<a href="README">README</a>" source depending on how you hit the link 
e.g. reverse proxy vs. direct ?  What makes my browser qualify the same 
HTML source into different URLs obviously ignoring the hostname portion of 
the URL?

I know I'm missing something really simple.


--
........................................................
......... ..- -. .. -..- .-. ..- .-.. . ... ............
.-- .. -. -... .-.. --- .-- ... -.. .-. --- --- .-.. ...

Sean O'Neill 


---------------------------------------------------------------------
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