Re: Load balancing to name-based virtual hosts

From: Jeff Buchbinder <jbuchbinder#ravewireless.com>
Date: Thu, 11 Dec 2008 14:06:21 -0500


David Rorex wrote:
> The simplest method would be to set up each server to respond to the
> same domain name. eg location1, location2, etc would all have the domain
> 'soap.vendor.com <http://soap.vendor.com>' set up. Then, a user requests
> soap.vendor.com <http://soap.vendor.com> from the haproxy load balancer,
> it gets randomly passed to one of the backends, which has no problem
> because it is set up to handle that name

Thanks. I already ended up implementing something like that, but had been looking for a way to do it on a per server basis (in the case that the vendor did not assign a common virtual host name to all servers). I just used this request rewrite line to do the mangling, in case anyone else needs it:

   reqrep ^(Host:\ )(.*) \1www.vendor.com

which would send the virtual host name "www.vendor.com" with the HTTP request.



Jeffrey Buchbinder
Senior Infrastructure Engineer
Rave Wireless, Inc
M: 860 617 5750
jbuchbinder#ravewireless.com
ravewireless.com Received on 2008/12/11 20:06

This archive was generated by hypermail 2.2.0 : 2008/12/11 20:15 CET