This article explains how to configure the origin server to work with the cdn

Origin HTTP Server

The origin server could be any http server, e.g. nginx, Apache, IIS. In some cases it could be a streaming media server like Wowza.
This server is the place we will get the content from when it is requested through the cdn.

In the control panel, there is a field named “Origin” in which you enter the address of this server.
This field allows the address to be either http:// or https:// and also supports a port number if needed. You can also specify a sub-directoy.

Some examples:
http://www.yoursite.com
https://yoursite.com
http://origin.yoursite.com:8080
http://www.yoursite.com/images

CDN Urls

In the control panel, your site “Name” is the reference used to connect the site to the origin content.
If you specified a CNAME-compatible name e.g. cdn.yoursite.com then you should configure your dns server for this cname (please see below in DNS section)

Content is then accessible on the cdn using http://cdn.yoursite.com/directory/file, which return the origin file at http://www.yoursite.com/directory/file
It is also accessible at http://<cdn address>/cdn.yoursite.com/directory/file (you must use this method if the name is not a cname)

Subdirectory note: As in the final example above, http://www.yoursite.com/images, the sub-directory is the entry point, so a cdn url of http://cdn.yoursite.com/test.png will correspond to the origin file http://www.yoursite.com/images/test.png

DNS

We provide a cdn address for each account. This is located in the cdn portal edit site screen in the field called “CNAME to”. You can use this address to set up a CNAME on your own dns server. Example

Name: cdn.yoursite.com
Record type: CNAME
Value: <account-id>-<hash>.c.stackcdn.io

CDN content is then accessible at http://cdn.yoursite.com

IP Restriction

If you wish, you can restrict origin access so that only the cdn can access it. Our range is 128.127.158.0/23 (128.127.158.0 – 128.127.159.254)

Expiry times

Setting expiry times at the origin server is an important step in having a smooth cdn relationship.
Please see Caching & Expiry Times

HTTP Segmented Video Configuration

It is important that when using HTTP segmented streaming (HLS/DASH/HDS/MSS) that the playlist at the origin server contains relative urls
This is so that the playlist get the segments from the cdn rather than the origin server.
In Wowza this is done by configuring the application type to “HTTP Origin”

Multiple origins

It is quite likely that you will have more than one origin server. In this situation it’s quite acceptable to create one cdn site per origin. Example

cdn.yoursite.com -> origin = www.yoursite.com
cdn-storage.yoursite.com -> origin = storage.yoursite.com

If you prefer to have just one cdn site, then configuring the origin to be set by the rules engine is also possible