httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: one proxy host--2 backend systems with same directory structure.
Date Sat, 08 Dec 2001 18:16:46 GMT

On Fri, 7 Dec 2001, Rick Lowe wrote:

> Issue:
> Front ending two backend systems which have the same directory structure,
> but different content in respective directories.
> for example
> <http://proxyhost/ibm> -->maps to -->. <http://backend.system.1/>
> example link
> (<A HREF="/images/image1.gifp">
> /images)
> <http://proxyhost/inside> -->maps to --> <http://backend.system2:90/>
> example link
> (<A HREF="/images/image1.gif">
> /images)
> The link directs browser browser to /images which the proxy host tries to
> serve up locally. So I setup a rewrite rule which prepends /ibm or /insite
> to the request. Problem is that only the first rewrite match gets executed.
> see example config below.

You can't use absolute URLs in a reverse proxy setup without a great deal
of gymnastics.  It just fundementally doesn't work.  You should change the
links on the backend server to relative links so that everything stays
under the /ibm directory.

>
> RewriteCond %{REQUEST_URI} !(^/insite(.*)$)
> RewriteRule ^/images(.*) /insite/images$1 [R]

This doesn't make any sense to me.  RewriteRule is itself matching against
the REQUEST_URI.  If the URI is /insite, then it can't simultaneously be
/images.  Perhaps you don't understand that each request to the server is
completely independent.  The only way to do something like this is by
looking at the HTTP_REFERER to see where the link was from.  But I don't
recommend this configuration, because the browser is not necessarily going
to send sensible things in the Referer header.

Joshua.


---------------------------------------------------------------------
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
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message