Adding a Domain Name
If you want to use CDN to accelerate your business, add the domain name of your site to CDN. CDN caches origin content on PoPs so that your content loads faster.
Procedure
Before adding a domain name, ensure that the domain name complies with the requirements described in Domain Name Requirements.
- Log in to the Huawei Cloud console. Choose .
The CDN console is displayed.
- In the navigation pane, choose .
- On the Domains page, click Add Domain Name and specify domain parameters. Figure 1 Adding a domain name
Table 1 Parameter description Parameter
Item
Description
Domain Name
-
- A domain name can contain up to 75 characters, including letters, digits, hyphens (-), and periods (.).
- You can add up to 100 domain names under each account.
- CDN does not allow access from websites containing illicit content. The existing domain names connected to CDN are reviewed regularly. If a domain name involves any violations, the CDN acceleration service will be suspended for the domain name and other domain names in your account.
- If a domain name has been in the Disabled or Rejected state for more than 120 days, the system deletes records associated with this domain name.
- CDN acceleration for domain names that have not been accessed for more than 180 days will be automatically disabled.
- An acceleration domain name must be unique.
- You can add a domain name including a wildcard (*). For example, if you add *.test.com to CDN as an acceleration domain name and have it resolved to the CNAME provided by CDN, all of the level-2 domain names under *.test.com, such as a.test.com, will enjoy CDN acceleration by default. However, level-3 domain names (such as b.a.test.com) would not.
- If you add a wildcard to a domain name for a particular account, you cannot add any of the level-2 domain names under that domain name to other accounts.
- You will be billed for the acceleration service provided to all of the level-2 domain names under a wildcard domain name. If there are multiple level-2 domain names, billing will be based on the traffic generated by the domain name with the wildcard, not on each of the level-2 domain names.
Enterprise Project
-
This parameter is only available if the Huawei Cloud Enterprise Project Management Service is enabled. For details, see Enterprise Management User Guide.
Service Area
Global
CDN schedules access requests from users around the world to the optimal PoP nearby. The domain name must be licensed by the Ministry of Industry and Information Technology (MIIT).
Chinese mainland
CDN schedules access requests from users around the world to PoPs in the Chinese mainland. The domain name must be licensed by the MIIT.
Outside Chinese mainland
CDN schedules access requests from users around the world to PoPs outside the Chinese mainland. The domain name does not need to be licensed by the MIIT.
Service Type
Website
CDN is perfect for web portals, e-commerce platforms, news apps, and user generated content (UGC)-focused apps. The cache format includes but is not limited to .zip, .exe, .wmv, .gif, .png, .bmp, .wma, .rar, .jpeg, and .jpg.
File download
CDN is useful for download clients, game clients, app stores, and websites that provide download services based on HTTP or HTTPS.
On-demand service
CDN accelerates delivery of on-demand services, such as online education, video sharing, music or video on demand, and other audiovisual content.
Whole site
CDN is a good option for websites that consist of both dynamic and static content and for sites that involve a large number of ASP, JSP, or PHP requests.
Origin Protocol
-
Protocol used by CDN PoPs to pull content from the origin server.
- HTTP
- HTTPS
- Same as user: The origin protocol is the same as the client access protocol. For example, if a client accesses CDN using HTTP, CDN also uses HTTP for origin pull.
- In the origin server settings area, click Add to add an origin server for the domain name. Figure 2 Adding an origin server
Table 2 Parameters Parameter
Description
Origin Server Address
Origin server IP address
- CDN PoPs access the IP address directly to pull origin content.
- If multiple IP addresses are configured, CDN uses load balancing to pull content from the origin server.
Origin server domain name
- An origin domain cannot be the same as an acceleration domain name.
- You can also enter the domain name of an object storage bucket in this field.
NOTE:- Private buckets cannot be used as origin servers.
- If you use an object storage bucket as your origin server, object storage service will charge the CDN origin pull traffic based on the billing standard for outgoing Internet traffic.
OBS bucket domain name
Select an OBS bucket domain name under your account or customize one. OBS charges the CDN origin pull traffic based on the billing standard for outgoing Internet traffic. If you set a bucket of OBS 3.0 or a later version as the origin server, you can purchase OBS pull traffic packages to deduct origin pull traffic. For details, see OBS Billing for CDN Acceleration.
Notes:
- If your OBS private bucket is unsuitable as an origin for your domain name, do not set the private bucket as the origin server.
- If a custom OBS bucket is used as the origin server, the origin domain name must end with .myhuaweicloud.com or .myhuaweicloud.cn.
- If an OBS private bucket is configured as an origin server, enable OBS Authorization and select the Private bucket checkbox. Otherwise, origin pull will fail. NOTE:
If you use CDN for the first time, you cannot set an OBS private bucket as the origin server when you add your first domain name. After adding the domain name, you can enable OBS authorization and then change the origin server to an OBS private bucket.
- To use a custom OBS private bucket as the origin server, configure a policy for the private bucket. For details, see Configuring a Policy for a Custom OBS Private Bucket.
- If you have enabled static website hosting for your OBS bucket, select the Static website hosting checkbox when adding a domain name. In this way, the list of all files in the bucket will not be displayed when users access the bucket.
Address
Address accessed by CDN PoPs during origin pull.
Bucket
This parameter is mandatory when Origin Server Address is set to OBS bucket domain name.
- Public bucket: public read. All users can read objects in the bucket.
- Private bucket: Only users granted permissions by the ACL can access the bucket.
Priority
The origin server can be primary or standby. The priority of the primary origin server is higher than that of the standby origin server. CDN PoPs preferentially pull content from the primary origin server. If the primary origin server is faulty, CDN PoPs pull content from the standby origin server.
- Configure at least one primary origin server.
Origin Port
Port number for CDN PoPs to pull content. By default, the HTTP port is 80 and the HTTPS port is 443.
- If Origin Server Address is set to OBS bucket domain name, the port numbers cannot be changed.
Host Header
A host is specified in the HTTP request header. It is the domain name of the site accessed by CDN PoPs when CDN pulls content from the origin server. CDN obtains resources from the corresponding site based on the host details during origin pull.
After a domain name is added, the default host will be the domain name. Change the host in a timely fashion if either of the following conditions is met:- If you select Origin server domain name for Origin Server Address and enter the domain name of an object storage bucket, set the host to the domain name of the object storage bucket.
- If you want CDN to pull content from a custom domain name, specify the host. For example, suppose an origin server is bound to two sites, www.origin01.com and www.origin02.com, and the domain name connected to CDN is www.example01.com. If you need CDN to pull content from www.origin02.com, you would need to set the host to www.origin02.com.
- Click OK. To add multiple origin servers, repeat 4. You can add up to 50 origin servers.
- The configuration takes 5 to 10 minutes to take effect. When Status of the domain name becomes Enabled, the domain name has been added.
- If the CNAME status of a domain name is
, no CNAME has been configured for this domain name.
- Check whether the host needs to be modified. If it does, configure the host by referring to Host Header. After a domain name is added, the default host will be the domain name. Change the host in a timely fashion if either of the following conditions is met:
- If you set Origin Server Address to Origin server domain name and enter the domain name of an object storage bucket, set the host to the domain name of the object storage bucket.
- If you want CDN to pull content from a custom domain name, specify the host. For example, suppose an origin server is bound to two sites, www.origin01.com and www.origin02.com, and the domain name connected to CDN is www.example01.com. If you need CDN to pull content from www.origin02.com, you would need to set the host to www.origin02.com.
Last Article: Enabling CDN
Next Article: Verifying the Domain Name Ownership
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.