Multiple domain names attached to same load balancer as alias records?

Zeni picture Zeni · Dec 17, 2014 · Viewed 12k times · Source

I have hosted multiple domain names (example.com and example.net ) on same instance in my auto scaling group. Now I have attached this auto scaling group to a load balancer. Using Route 53 can I point two zone apex (such as example.com and example.net) to same load balancer as alias records?

Answer

Michael - sqlbot picture Michael - sqlbot · Dec 17, 2014

Yes, you can.

However, you need to keep the following considerations in mind, depending on what your application requires:

  • ELB forwards the Host: header to the instance; it doesn't interpret it, so your web servers are responsible for reacting to the Host: header in the incoming request, and handling each site appropriately.

  • ELB will load balance all the requests among all of the instances, regardless of which domain they are for, since it doesn't know (or care).

  • ELB can only serve up a single SSL certificate. If you are using SSL, you have to have exactly one cert that's valid for all of the domain names, or, you have to run the ELB listener in transparent (TCP, not HTTPS) mode and handle the SSL certs with SNI on the instances, themselves. If you can't meet this constraint, you need one ELB per SSL cert, so the original question is moot -- each ELB has its own target for use with aliases.