[Scottish] mod_proxy with a dash of mod_rewrite

Gary Hendricks merlin at project415.org
Sun Jan 14 11:11:53 GMT 2007

I have been struggling a wee while with something.

Here is the scenario:


I have a normal webserver on web1 that serves general pages.
The web2 is an internal webserver that serves all kinds of media with

The problem is that i want to address both of these servers via the net 
on the same port (80)

o Firewall accepts the connect and passes it on to web1
o web1 checks the servername and then forwards the connection onwards if
it is for web2.

web2 has complex urls ie http://web2/index.php?3d%2FC4sbo2w%
web1 also has complex urls with /index.php

Simple ProxyPass does not seem to work as it makes the url impractical
ie  http://web1/media/ and although the first page is from web2,
subsequent pages are from web1 when the url changes to the more complex one.

The current config on web1 is as follows:

<VirtualHost *>
  ServerName web2
   ProxyRequests On
   ProxyPass         /media/ http://web2/

Another option

  <VirtualHost *>
  ServerName web2
   ProxyRequests On
   ProxyRemote http://media/ http://web2/

(This last one would be alias the server as media which is perhaps a 

Any other suggestions?


More information about the Scottish mailing list