You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modproxy-dev@apache.org by Graham Leggett <mi...@sharp.fm> on 2002/07/04 20:29:19 UTC

Re: BUG or FEATURE? a reverse proxy question.

PINTO Jose Silva wrote:

> Why isn't apache adjusting the URL before forwarding the HTTP redirect
> response to the client?

It's not practical.

> Problem description:
> According to httpd.conf file below, a local request to
> <http://frontend-server/foo/> is converted into a proxy request
> <http://backend-server/>. Until here everything is ok! 
> 
> In backend server I have a page that contains a reference to some image,
> (e.g. 
> <img src="/image-dir/some-image.gif">). 
> 
> I'm unable to see this image through a proxy request, because this reference
> is being adjusted to <http://frontend-server/image-dir/some-image.gif>
> instead of <http://frontend-server/foo/image-dir/some-image.gif>. 

This is because Apache only fiddles with the header of the request, not 
the content of the body.

Trying to parse the body of a response to detect and change URLs is far 
too expensive and error prone to be practical. Rather stick to relative 
links (../image-dir/some-image.gif) or keep the URL space on the backend 
the same as the URL space on the frontend (ie host it on 
http://backend/foo/ instead of http://backend/).

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm 
	"There's a moon
					over Bourbon Street
						tonight..."