How to debug a CDN service
06 Jul 2014

Let’s take a look what you can do if something is wrong with your CDN Static or CDN Static Push service.

Please note that the following does not apply to streaming CDN services (CDN Video, CDN Video Push and CDN Live). Also note that the only difference between CDN Static and CDN Static Push services is their . CDN Static Push services have their origin at one of our push servers, so in particular their Origin Domain is similar to u88069393245.s.push-11.cdnsun.com. In the following we will restrict ourself to CDN Static services.

Let’s assume that you have created a CDN Static service with the following details.

  • Service Domain – static.mycompany.com
  • Service Identifier – 876217123.r.cdnsun.net
  • Origin Domain – mycompany.com

DNS – dig is your friend

Note that the Service Identifier is a ready-to-use domain which servers your CDN content. If you would like to use the Service Domain then you need to add a CNAME record to your DNS configuration. Use dig tool to find out whether the CNAME record is set up correctly. Note that you can use dig tool from command line and also online. Dig your Service Domain static.mycompany.com and check the result. You should see something similar to the following.

static.mycompany.com.	21599	IN	CNAME	876217123.r.cdnsun.net.

If you don’t see the CNAME record in the dig result then your CNAME record is not set up correctly.

Content – curl is your friend

First of all, your origin content has to be accessible via HTTP (not HTTPS) and it must return 200 status codes only. Please refer to Status Code Definitions for more details. Also please note that when you create a new CDN service it can take up to 15 minutes to propagate it to all Locations, so don’t worry if your CDN service does not show up immediately.

Let’s assume that you can’t access your CDN content located at the following URI.

http://static.mycompany.com/htdocs/images/image.jpeg 

Use curl to find out whether the same content at your origin returns 200 status code or not. Note that you can use curl from command line and also online. An example of curl result follows.

curl -I http://mycompany.com/htdocs/images/image.jpeg

HTTP/1.1 200 OK
Date: Sun, 06 Jul 2014 07:22:43 GMT
Server: Apache
Last-Modified: Wed, 25 Jun 2014 03:00:28 GMT

If your origin content does not return 200 status code then please set up your origin correctly. Also please note that when you change settings at your origin then you may need to purge your CDN content as it has been cached with the old origin settings (HTTP headers). Please refer to Purge and prefetch your CDN content for more details.

Sincerely your CDNsun team.