httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean O'Neill <s...@seanoneill.info>
Subject Re: [users@httpd] RESOLVED - Problem with Rev Proxy config and mod_rewrite
Date Thu, 06 Mar 2003 16:47:22 GMT

Date: Thu, 06 Mar 2003 10:45:06 -0600
To: users@httpd.apache.org
From: Sean O'Neill <sean@seanoneill.info>
Subject: Re: [users@httpd] RESOLVED - Problem with Rev Proxy config and 
mod_rewrite

At 11:58 PM 3/5/2003 -0600, Sean O'Neill wrote:
>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

<SNIP>


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

Subversion (in Apache) requires directory URIs to end in "/" 
character.  That's what my RewriteRules above are for.  If you hit the 
Subversion Apache directory as "http://compaq.nonroutable.com/repos" 
(notice no trailing "/") you get back a 301 response redirecting you to 
"http://compaq.nonroutable.com/repos/" (notice the trailing "/").

Well, when going through the reverse proxy, the end-user browser never gets 
the 301 - the Apache Reverse Proxy does.  So the client never adjusts it 
understanding of how to interpret the HTML source.

By adding this on the Reverse Proxy:

Redirect permanent /repos http://www.firewall.com/repos/

before the other rules, the end-user browser now gets a 301 and it properly 
handles the link qualification correctly.


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

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