Server configuration FAQ

How do I configure CNAME?

Go to the domain name management company and find the parsing manager for the domain name. Delete the A record for the domain, and add a CNAME record. You should already have the domain name for CNAME.

How do I confirm that my CNAME record has taken effect?

The time at which Domain Name System (DNS) changes take effect varies between regions, and depends on the time at which the original record corresponding to the domain name takes effect (time to live [TTL]).If pinging (or digging) the domain name no longer resolves your source station IP, the CNAME record has already taken effect.

How do I ensure that content is synchronized with the source station after I set up Azure Content Delivery Network?

  • When you set cache rules, you should set different cache refresh rules for different content. To reduce pressure on the source station, you can set shorter cache times for frequently updated content and longer cache times for content that is not regularly updated.

  • If the cache refresh period that you set does not expire, but new content is published or some of the content is deleted, you can use the cache refresh features provided by the Content Delivery Network management platform to manually force it to refresh.

[!NOTE] If you want to update only one particular file, we recommend that you use File Refresh to refresh the updated file. Directory Refresh will refresh all the files in the directory. This refresh can take some time to take effect.

How do I enter the return-to-source host header?

When you create the Content Delivery Network in the Azure portal, enter the return-to-source access host header that's accepted by your source station in the origin host header. After you have entered the custom domain, the system automatically fills in a default value based on the origin domain type that you selected. Specifically, your source station is on Azure, the default value is the corresponding source station address. If your source station is not located on Azure, the default value is the custom domain name that you entered.

If your source station is by default unable to use the custom acceleration domain name for access, you will need to configure the return-to-source host header. You should configure it based on your specific situation, but in general you can configure the source station domain name at this time. If the source station has other configurations, those configurations should be followed.

**How do I change the source station address? **

First, make sure that the new source station is working normally. Then go to the domain name management section in the Azure Content Delivery Network advanced management platform, change the source station address to the new address, and then save the change.

[!NOTE] If there are any changes to the real IP of the source station, whenever possible, you should remove the old IP after the configuration has taken effect.

How do I set up cache refresh?

  • Setting cache rules: You can set different cache refresh rules for different content on the Content Delivery Network management platform. You should set shorter cache times for frequently updated content and longer cache times for content that is not regularly updated, to reduce pressure on the source station.

  • Manual refresh: If the cache refresh period you set does not expire, but new content is published or some of the content is deleted, you can use the cache refresh features provided by the Content Delivery Network management platform to set a file refresh and directory refresh as required, to perform a manual refresh.

[!NOTE] If you want to update only one particular file, we recommend that you use File Refresh to refresh the updated file. Directory Refresh will refresh all the files in the directory. This refresh can take some time to take effect.

How do I obtain a visitor’s originating IP address from the source station log?

After a website is accelerated by using Content Delivery Network, the vast majority of visits will come from the network cache nodes. When the Content Delivery Network returns to the source, it will enter the originating IP address in the HTTP Header X-Forwarded-For. You can edit the source station’s web server log configuration so that this information is recorded.

If we take NGINX as an example, you can add the following information to the configuration file:

log_format logCDN '$remote_addr forwarded for $http_x_forwarded_for - $remote_user [$time_local] '

'"$request" $status $body_bytes_sent '

'"$http_referer" "$http_user_agent"';

access_log /var/log/nginx/access.log logCDN;

How do I bind Content Delivery Network edge nodes?

After you have successfully created a Content Delivery Network server for your source station www.mydomain.com on the Content Delivery Network platform by using the customized domain name cdn.mydomain.com, you will receive the accelerated domain name cdn.mydomain.com.mschcdn.com. You can bind the host to perform basic troubleshooting. You can do this by doing the following:You can bind the host to perform basic troubleshooting. This is done by using the following procedure:

  1. Ping cdn.mydomain.com.mschcdn.com to obtain the IP address of the edge node (for example, a.b.c.d.).

    1. Edit the local host's file, and then add the record a.b.c.d www.domain.com.
  2. Visit www.domain.com in a browser. If the website opens correctly, there are no problems with the Content Delivery Network. If you cannot access the website, but the website can be successfully accessed after the IP address in the host file is changed to the IP address of the source station, there is a problem with the Content Delivery Network server.

[!NOTE] In Windows, the path for the hosts file is C:\Windows\System32\drivers\etc\hosts.

  • In UNIX-like operating systems such as Linux or BSD, the path for the hosts file is /etc/hosts.Administrator privileges are required to edit this file. ****For the Azure Blob service and Cloud Services, you will get a 404 error message if you directly access the domain name. In such cases, you can troubleshoot by visiting a valid URI.