The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024

Latest message you have seen: RE: Windows Home Server performance - very slow.. any ideas?


[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

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.