When you create an Nginx webserver from an image and configure the web routing rules, you only need to enter the domain name prefix
nginx. Then, you can obtain the domain name in the format of
$cluster_id.$region_id.alicontainer.com. You can replace this domain name by setting a root domain name (
51ili.com is used in this example) of the cluster. When you redeploy the application
nginx, the domain name changes from
nginx.51ili.com, which makes it convenient for you to access the cluster applications with your own root domain name.
Note: To guarantee the normal operation of the following example, upgrade the Agent to the latest version first.
Bind a Server Load Balancer instance.
Log on to the Container Service console.
Click Clusters in the left-side navigation pane.
Click Manage at the right of the cluster (
routing-test-onlinein this example) that you want to configure.
Click Load Balancer Settings in the left-side navigation pane.
If no Server Load Balancer instance is bound to this cluster, log on to the Server Load Balancer console and create a Server Load Balancer instance. Then, return to this page and bind the instance to this cluster.
Note: For more information about how to bind and unbind a Server Load Balancer instance to and from a cluster and the limits in Container Service, see Bind and unbind a Server Load Balancer instance.
Set the domain name.
Click the Set Domain Name tab and enter the root domain name you bought in the Domain Name field. In this example, 51ili.com is entered.
Resolve the domain name to the bound Server Load Balancer instance.
Log on to the Server Load Balancer console. Click Instances in the left-side navigation pane, and then click the ID of the Server Load Balancer instance bound to the cluster
View the instance details. Find the instance IP address.
Log on to the Alibaba Cloud DNS console and add a DNS record.
Redeploy the nginx application.
Click Redeploy at the right of nginx.
The service access endpoint of the application
The access endpoint before setting the root domain name.
The access endpoint after setting the root domain name.
Access the latest access endpoint