BUG or FEATURE? a reverse proxy question.

BUG or FEATURE? a reverse proxy question.

am 04.07.2002 17:32:44 von PINTO Jose Silva

(my apologises if this question isn't in the write place)

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

Problem description:
According to httpd.conf file below, a local request to
is converted into a proxy request
. Until here everything is ok!

In backend server I have a page that contains a reference to some image,
(e.g.
).

I'm unable to see this image through a proxy request, because this reference
is being adjusted to
instead of .

#--- here is my httpd.conf file in frontend server ----
....

...
ProxyPassReverse /foo/ http://backend-server/

RewriteEngine On
RewriteRule ^/foo/(.*) http://backend-server/$1 [P]
...

#---

Thanks
Jose Pinto.

Re: BUG or FEATURE? a reverse proxy question.

am 04.07.2002 17:54:58 von Manon Goo

you coluld solve the problem by using mod_rewrite and checking the referrer
for /foo/ ....

Manon

--On Donnerstag, 4. Juli 2002 16:32 Uhr +0100 PINTO Jose Silva
wrote:

> (my apologises if this question isn't in the write place)
>
> Why isn't apache adjusting the URL before forwarding the HTTP redirect
> response to the client?
>
> Problem description:
> According to httpd.conf file below, a local request to
> is converted into a proxy request
> . Until here everything is ok!
>
> In backend server I have a page that contains a reference to some image,
> (e.g.
> ).
>
> I'm unable to see this image through a proxy request, because this
> reference is being adjusted to
> instead of
> .
>
># --- here is my httpd.conf file in frontend server ----
> ...
>
> ...
> ProxyPassReverse /foo/ http://backend-server/
>
> RewriteEngine On
> RewriteRule ^/foo/(.*) http://backend-server/$1 [P]
> ...
>

># ---
>
> Thanks
> Jose Pinto.
>

Re: BUG or FEATURE? a reverse proxy question.

am 04.07.2002 20:29:19 von Graham Leggett

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
> is converted into a proxy request
> . Until here everything is ok!
>
> In backend server I have a page that contains a reference to some image,
> (e.g.
> ).
>
> I'm unable to see this image through a proxy request, because this reference
> is being adjusted to
> instead of .

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