edit-icon download-icon

Server Load Balancer + ECS multi-site deployment

Last Updated: Feb 02, 2018

You can build multiple sites on an ECS instance by creating virtual sub-directories. Server Load Balancer supports adding this type of ECS instance as a backend server to forward traffic. Both layer-4 and layer-7 Server Load Balancer support adding multi-site ECS instances and the function is not influenced by session persistence.

This tutorial illustrates how to create a TCP listener and add an ECS instance deployed with two sites.

  1. On the ECS01, create the site www.aaa.com and the site www.bbb.com through creating sub-directories.

    Nginx配置文件 The content displayed on the site www.aaa.com is shown as the following figure.

    www.aaa.com

    The content displayed on the site www.bbb.com is shown as the following figure.

    www.bbb.com

    You can bind the two domain names to the public IP address of the ECS instance in the local host file and use the browser to visit ww.aaa.com and www.bbb.com. If the preceding contents are displayed, the configuration is successful.

  2. Create a custom image for the ECS01 and use the image to create ECS02 with the same configuration.

  3. Create an Internet Server Load Balancer instance and add a TCP listener.

  4. Add the ECS01 and the ECS02 as backend servers.

  5. In the local host file, resolve the domain name www.aaa.com and the domain name www.bbb.com to the public IP address of the Server Load Balancer instance.

    Host文件

  6. Enter www.aaa.com and www.bbb.com in the browser. If the corresponding backend services can be accessed, the deployment is successful.

    站点A

    站点B

Thank you! We've received your feedback.