Alibaba Cloud CDN supports wildcard domain names. This topic introduces wildcard domain names and describes how to add a wildcard domain name to Alibaba Cloud CDN.
What is acceleration of wildcard domain names?
Acceleration of wildcard domain names is the acceleration of domain names that match a specified wildcard domain name. You can add a wildcard domain name to Alibaba Cloud CDN, and then domain names that match the wildcard domain name are accelerated. For example, .aliyundoc.com
is a wildcard domain name. example.aliyundoc.com
is a second-level subdomain of .aliyundoc.com. image.developer.aliyundoc.com
is a third-level subdomain of .aliyundoc.com.
For example, .aliyundoc.com
is added to Alibaba Cloud CDN as a wildcard domain name. After .aliyundoc.com
is mapped to the CNAME that is assigned by Alibaba Cloud CDN, all domain names that match .aliyundoc.com, such as example.aliyundoc.com
and demo.aliyundoc.com
, are mapped to the CNAME of .aliyundoc.com
, and accelerated by Alibaba Cloud CDN.
Alibaba Cloud CDN only accelerates second-level subdomains that match the wildcard domain name. For example,
example.aliyundoc.com
that matches.aliyundoc.com
can be accelerated butimage.developer.aliyundoc.com
cannot be accelerated. If a request toimage.developer.aliyundoc.com
is sent to a point of presence (POP), the POP rejects the request and returns the HTTP 403 status code.Alibaba Cloud CDN identifies domains, such as .com.cn, .net.cn, .gov.cn, edu.cn, and .org.cn, as top-level domains. For more information about the domains, visit https://publicsuffix.org/list/public_suffix_list.dat. For example,
.aliyundoc.com.cn
is a wildcard domain name. In this case,example.aliyundoc.com.cn
is a second-level subdomain andimage.developer.aliyundoc.com.cn
is a third-level subdomain.When you purge or prefetch content from an origin server based on URLs or directories, the URLs or directories cannot be the URLs or directories of a wildcard domain name. You need to specify URLs or directories of a specific domain name. For example,
http://.aliyundoc.com/example/b.mp4
is not supported buthttp://example.aliyundoc.com/example/b.mp4
is supported.
Rules for adding wildcard domain names
When you add a wildcard domain name to Alibaba Cloud CDN, take note of the following rules:
The wildcard domain name must be less than 100 bytes in length.
A wildcard domain name can be in one of the following formats:
.aliyundoc.com
and*.aliyundoc.com
. Both formats produce the same result. In this example,.aliyundoc.com
is displayed in the console regardless of the format that is used.Alibaba Cloud CDN supports multi-level wildcard domain names, such as *.example.aliyundoc.com, *.image.example.aliyundoc.com, and *.cat.image.example.aliyundoc.com.
You are charged data transfer fees for domain names that are matched by wildcard domain names in the same manner as specific domain names. Data usage generated by domain names that are matched by wildcard domain names is summarized and displayed on the Resource Monitoring page of the Alibaba Cloud CDN console. Alibaba Cloud CDN considers each wildcard domain name as an individual accelerated domain name. Therefore, Alibaba Cloud CDN provides the billing details of wildcard domain names (accelerated domain names) instead of the domain names that match the wildcard domain names.
Logs of wildcard domain names
A log file is generated for each wildcard domain name at each time interval. The log file contains log data of all domain names that match the wildcard domain name. For more information about logs, see Overview.
Procedure
Log on to the Alibaba Cloud CDN console.
Add a wildcard domain name to Alibaba Cloud CDN. For more information, see Add a domain name.