Set the root domain name of a cluster

Last Updated: Jun 26, 2017

In Create a Nginx Web server from an image, when you set the web routing rules, you only need to enter the prefix nginx of the domain name. Then, you obtain the domain name nginx.$cluster_id.$region_id.alicontainer.com. You can replace this domain name by setting a root domain name (example.com is used in this example) of the cluster. When you redeploy the service nginx, the domain name changes from nginx.c2818a77aac20428488694c0cd1600e6e.cn-shenzhen.alicontainer.com to nginx.example.com, which makes it convenient for you to access the cluster applications with your own root domain name.

The following example details the complete process.

Note: To guarantee the normal operation of the following example, upgrade the Agent to the latest version first.

Operating procedure

  1. Bind a Server Load Balancer instance.

    1. Log on to the Container Service console.

    2. Click Clusters in the left navigation pane.

    3. Locate the cluster to be configured (routing-test-online is used in this example), and click Manage.

      manage

    4. Click Load Balancer Settings in the left navigation pane.
      If no Server Load Balancer instance is bound, log on to the Server Load Balancer console and create a Server Load Balancer instance; and then, return to this page and bind it.

      Note: Server Load Balancer instance bound with an intranet is supported.

      1

  2. Set the domain name.

    1. Click Set Domain Name and enter the root domain name you bought.
      In this example, example.com is used.

      2

    2. Click Settings.

  3. Resolve the domain name to the bound Server Load Balancer instance.

    1. Click Server Load Balancer Settings and click Go to Server Load Balancer Console.

      3

    2. Find the VIP address of the bound Server Load Balancer instance.

      5

    3. Ask your DNS resolver service provider to resolve your domain (*.example.com in this example) to the Server Load Balancer VIP address.

  4. Redeploy the web service.

    1. Redeploy your application. The web service access endpoint under the application will change to $your_domain_prefix.example.com.

    2. Access the latest access endpoint http://wordpress.example.com, you will see the “Hello World” page of WordPress.

Thank you! We've received your feedback.