[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

http proxy with Apache



I'm trying to set up my Apache server to act as a proxy for certain
requests and I'm not getting the desired behavior.  Over here, we can
connect to a remote http server that allows access based on IP
addresses (and we have been granted access).  The problem is that one
of my users connects remotely and has a different IP address, so I'm
trying to set up the local Apache server to act on behalf of his
requests.  So, when he types in http://foo.com/bar, I want that to
expand to http://bar.com/.  I added the following lines to
/etc/apache/httpd.conf:

ProxyRequests on
ProxyPass /bar/ http://bar.com/
ProxyPassReverse /bar/ http://bar.com/

So, http://foo.com/bar ends up loading http://bar.com/index.html,
which is what I want.  However, index.html contains links.  Links of
the form "index2.html" get interpreted properly as
http://foo.com/bar/index2.html but links of the form
"/blah/index3.html" get interpreted as
http://foo.com/blah/index3.html, which obviously fails.  Does anyone
know how to fix this and force ALL links on bar.com to go through
http://foo.com/bar?

Thanks,
    Max

-- 
The hopeful depend on a world without end
Whatever the hopeless may say
     Neil Peart, 1985

Attachment: pgpfbAw8yUgzf.pgp
Description: PGP signature


Reply to: