2

I am in the process of setting up a network of web servers on Rackspace. I am looking to do 4 servers in groups of two. See diagram below.

enter image description here

My question is, if I have server A and server B as a mirror of A behind the load balancer I know I can get this working. My question is, if I have a second set of two servers hosting different websites, can I have the servers behind the same load balancer? Currently the LB is set up to do round robin, and when I do try to do this when I hit the site abc.com sometimes it will just show the default webpage from one of the servers C or D.

bretterer
  • 135

2 Answers2

2

it all depends on the type of the load balancer. but in general yes - it's doable.

for instance nginx can handle multiple vhosts and have separate configurations for each of them. keep one thing in mind - if both sites will require https [not just http] - you'll need separate ip address for each of the ssl-enabled sites. otherwise single ip for multiple sites will work just fine [as long as the requests can be routed based on different dns names].

you can find nginx-specific example for multiple vhosts here, and for load balancing - here.

even more complicated load balancing scenarios are possible. for instance one where the balancer routes the traffic so server a handles abc.com, def.com, server b - abc.com, def.com, uvw.com, c - uvw.com, xyz.com and so on.

pQd
  • 30,537
2

I confirmed that Rackspace's Cloud Load Balancer does not currently support the idea of multiple services behind 1 instance (routing based on host header). You'd either need:

  1. all nodes to serve up all websites
  2. separate LB instances for each pool of applications/sites