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.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.
Bind a Server Load Balancer instance.
Log on to the Container Service console.
Click Clusters in the left navigation pane.
Locate the cluster to be configured (routing-test-online is used in this example), and click Manage.
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.
Set the domain name.
Click Set Domain Name and enter the root domain name you bought.
In this example,
Resolve the domain name to the bound Server Load Balancer instance.
Click Server Load Balancer Settings and click Go to Server Load Balancer Console.
Find the VIP address of the bound Server Load Balancer instance.
Ask your DNS resolver service provider to resolve your domain (
*.example.comin this example) to the Server Load Balancer VIP address.
Redeploy the web service.
Redeploy your application. The web service access endpoint under the application will change to
Access the latest access endpoint
http://wordpress.example.com, you will see the “Hello World” page of WordPress.