[Date Prev][Date
Next][Thread Prev][Thread Next][Date
Index][Thread Index]
Re: Re: Apache Reverse proxying - WAS Introduction and first
questions
> Ok - the next question - instead of having a virtual host... can you
> have a virtual directory that gets its source from another host?
Yes you can.
> www.planetwayne.com -> my default web server - pages and all,
normal
> there...
> www.planetwayne.com/images -> returns web pages from another host
(via
> proxy) eg 192.168.1.2/images/camera1/
You'd use something like the following, within your main virtual host:
ProxyPass /images/ http://192.168.1.2/images/camera1/
ProxyPassReverse /images/ http://192.168.1.2/images/camera1/
So, whenever you went to www.planetwayne.com/images/, you'd actually be
seeing 192.168.1.2/images/camera1/
Basically the first argument to ProxyPass is the urlspace you want to map,
i.e. / will proxy the whole site, or /images/ will just do the images
directory.
The second argument is the URL where the requests should go, i.e. http://192.168.1.2/images/camera1/
Remember to always have a ProxyPassReverse directive as Mark says,
otherwise you can run into strange problems with redirects. The syntax for
ProxyPassReverse is the same as that for ProxyPass.
Also be careful with sites that use absolute URLs though, as if the source
site thinks it lives in /images/camera1/ and you're proxying it to
/images/, you could end up with some broken links, though there's always
mod_rewrite to help out there, though that's another story entirely!
HTH,
John
Home |
Main Index |
Thread Index
|