httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krist van Besien" <>
Subject Re: [users@httpd] proxying on virtual host name
Date Tue, 25 Apr 2006 09:55:36 GMT
On 4/25/06, Sebastian Reitenbach <> wrote:
> Hi,
> i have one public IP address available, and I want two http hosts behind this
> IP. With only one host, I would use virtual hosts, deciding on the used
> hostname which site to show the user as the answer.
> So with the firewall i cannot distinguish for source or destination IP
> address, as both can be for each host. So I have to redirect all incoming
> traffic to just one apache server. Is there a module available that will
> analyze the HOST information sent from the client to the server, and then
> redirect it to one or the other host?
> Or is there something built into apache that can handle this on its own or any
> other way?

You probably can do this with a rewrite:

RewriteEngine On
RewriteCond %{HTTP_HOST}   !^www\.domain2\.com [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://server2:/$1 [P]

This will proxy every request for to the server named server2.

The other way is to have two virtual hosts on your first server, just
as if both your websites ran on the same machine, and have one of the
virtual servers proxy everything to the second server.


Solothurn, Switzerland

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message