Re: [users@httpd] proxying on virtual host name

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

 



On 4/25/06, Sebastian Reitenbach <itlistuser@xxxxxxxxxxx> 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 www.domain2.com 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.

Krist

--
krist.vanbesien@xxxxxxxxx
Solothurn, Switzerland

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux