If you want to use Alibaba Cloud CDN to accelerate content delivery for a specific website, you need to add the domain name that you want to accelerate to Alibaba Cloud CDN. After you add a domain name to Alibaba Cloud CDN, the system pushes the configuration of the domain name to all points of presence (POPs) without affecting the services of the domain name.
An origin server that provides stable performance is deployed. The domain name that you want to accelerate is available.Note
If the acceleration region is Chinese Mainland Only or Global, you need to apply for an Internet Content Provider (ICP) number for the domain name. If you do not have an ICP number, you can perform ICP filing by using the Alibaba Cloud ICP Filing System.
Alibaba Cloud CDN is activated. For information about how to activate Alibaba Cloud CDN, see Activate Alibaba Cloud CDN.
Step 1: Configure business information
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, click Add Domain Name. On the Add Domain Names page, configure parameters in the Business Information section.
Global Resource Plan
If you set the Region parameter to Global (Excluding the Chinese Mainland) and enable Global Resource Plan, more POP resources are available for your domain name. For more information, see Enable the global resource plan.
Domain Name to Accelerate
After you configure the Business Type parameter, you cannot modify the parameter.
Step 2: Set up origin servers
After you configure parameters in the Business Information section, click Add Origin Server.
In the Add Origin Server dialog box, configure the parameters that are described in the following table.
Select the type of the origin server and enter the address of the origin server.
OSS domain name
If your origin server is an Object Storage Service (OSS) bucket, you can select or enter the public domain name of the OSS bucket, such as
***.oss-cn-hangzhou.aliyuncs.com. Alibaba Cloud CDN does not support internal domain names of OSS buckets.
You can obtain the public domain name of an OSS bucket in the OSS console. You can also select the domain name of an OSS bucket that belongs to the current Alibaba Cloud account from the Domain Name drop-down list.
Discounts for data transfer between Alibaba Cloud CDN and OSS:
If you want OSS to identify network traffic that is sent from Alibaba Cloud CDN and apply for a discount on the data transfer, you need to set the origin server type to OSS Domain in the Alibaba Cloud CDN console.
If you set the origin server type to Site Domain in the Alibaba Cloud CDN console, OSS identifies network traffic that is sent from Alibaba Cloud CDN as outbound data transfer over the Internet. In this case, the discounts do not apply.
For more information, see Billing of OSS content acceleration.
IP address: You can configure one or more origin IP addresses. Internal IP addresses are not supported. IPv4 addresses and IPv6 addresses are supported. At least one of the IP addresses must be an IPv4 address. If you use a public IP address of an Alibaba Cloud Elastic Compute Service (ECS) instance as the address of the origin server, the IP address is exempt from manual review.
Site Domain: Enter the domain names of one or more origin servers.Note
The origin domain name must be different from the accelerated domain name. Otherwise, a DNS resolution loop occurs, and requests cannot be redirected to the origin server.
The format of the origin domain name:
The domain name must be 1 to 67 characters in length.
The domain name can contain lowercase letters, digits, and hyphens (-). Example: example.com.
The domain name cannot contain Chinese characters, uppercase letters, or special characters other than hyphens (-). The domain name cannot be only a hyphen (-). A hyphen (-) in a domain name cannot be followed by another hyphen (-). The domain name cannot start or end with a hyphen (-). If the domain name contains Chinese characters, such as 阿里云.网址, you must apply for an ICP number for the domain name in Chinese characters and use the Punycode tool to convert the Chinese characters into English letters, such as xn--fiq****.xn--eq****. Then, you can specify the converted domain name as the domain name that you want to accelerate.
You can add the address of an Alibaba Cloud Application Load Balancer (ALB) instance, such as
example.hangzhou.alb.aliyuncs.com, as the address of an origin server.
Function Compute Domain: Enter a Function Compute domain name that belongs to the current Alibaba Cloud account. If you select this value, you need to configure the Region and Domain Name parameters. For more information, see Configure a custom domain name.
You can configure priorities to specify primary and secondary origin servers. The primary origin server has a higher priority than the secondary origin server. Alibaba Cloud CDN preferentially redirects requests to the primary origin server. If a fault occurs on the primary origin server, requests are redirected to the secondary origin server. The priority ranges from 0 to 127. A smaller value indicates a higher priority. By default, the priority of the primary origin server is 20, and the priority of the secondary origin server is 30. If you want to specify other values, submit a ticket.
For example, you specify Origin Server A as the primary origin server and Origin Server B as the secondary origin server. In this case, Alibaba Cloud CDN preferentially redirects requests to Origin Server A. If Origin Server A fails, Alibaba Cloud CDN redirects user requests to Origin Server B. After Origin Server A recovers, Alibaba Cloud CDN fails back to Origin Server A.
If origin servers have the same priority, Alibaba Cloud CDN redirects requests to the origin servers based on the weights of the origin servers. This way, loads are balanced among the origin servers. You can specify a weight based on your business requirements.
The weight of an origin server ranges from 1 to 100. An origin server that has a higher weight receives more requests.
Default value: 10.
For example, you specify Origin Server A and Origin Server B as primary origin servers. If the weight of Origin Server A is 80 and the weight of Origin Server B is 20, Alibaba Cloud CDN redirects 80% of requests to Origin Server A and 20% of requests to Origin Server B.Note
In the following scenarios, the proportion of requests that are redirected to an origin server may not be the same as the weight of the origin server that you specified:
When a small number of requests are redirected to origin servers within a period of time, such as less than 10 requests per second, request distribution across origin servers is uneven.
All requests are from a specific IP address or a limited number of IP addresses. Requests from the same IP address are sent to the same POP, and a TCP session is maintained between the POP and an origin server.
If you want to verify whether the actual proportion of requests that are redirected to an origin server is approximately the same as the weight that you configured for the origin server, you can use a third-party synthetic monitoring tool to initiate a probe task. You can probe clients that are distributed across locations and are served by Internet service providers (ISPs) based on your business requirements. The probe task requires a long period of time to collect sufficient and valid probe data.
The port on the origin server that processes requests. The default port is port 80. You can specify a port based on the settings of your origin server. Valid values: 1 to 65535.
Default value: 80.
If you specify port 443, requests are redirected to the origin server over HTTPS. If you specify port 80 or a custom port, requests are redirected to the origin server over HTTP.
If you want Alibaba Cloud CDN to redirect HTTPS requests to origin servers over custom ports, configure the origin protocol policy. For more information, see Configure the origin protocol policy.
If the Origin Protocol Policy feature is enabled, the port that is specified by this parameter becomes invalid. By default, the feature is disabled. For more information about how to disable the origin protocol policy feature, see Configure the origin protocol policy.
If the origin server is an Object Storage Service (OSS) bucket, OSS determines whether you can specify a custom port.
After you configure the preceding parameters, click OK.
Optional. Repeat the preceding steps to add multiple origin servers.Note
For information about health check policies for origin servers, see Back-to-origin retry, back-to-origin timeout, and origin probing.
Step 3: Complete ownership verification
After you add an origin server, click Next.
Wait for manual verification to complete.Note
If the domain name does not need to be manually verified, proceed to the next step. In the next step, you can configure the parameters based on your business requirements.
After the domain name passes the verification, the status of the domain name changes to Enabled. In this case, the domain name is added to Alibaba Cloud CDN.
What to do next
Add a CNAME record for a domain name: After you add a domain name to Alibaba Cloud CDN, Alibaba Cloud CDN assigns a CNAME record to the domain name. You need to add the CNAME record for the domain name before Alibaba Cloud CDN acceleration can take effect.
We recommend that you perform the following operations before you Add a CNAME record for a domain name:
Configure system-recommended features (optional): You can specify cache expiration rules and bandwidth caps to increase cache hit ratios, reinforce protection, and improve content delivery performance.
Test whether a domain name is accessible (optional): You can perform this operation to ensure that DNS updates do not affect the services of your website.
Related API operations and documentation
Add domain names
For more information about accelerated domain names, see accelerated domain name.