Creating and Configuring CDN Resources
To enable the CDN from the control panel:
- Open the CDN section.
- Click Create CDN resource.
- Choose a CDN provider:
|CDN Selectel||CDN Akamai|
|Points of presence around the world||26||2200|
|Points of presence in Russia||13||32|
- Click Configure CDN resource.
- Enter CDN Resource Name. The name is entered for convenience in the control panel.
- Select a content source.
- Indicate Interaction protocol between the CDN and the content source — HTTP или HTTPS.
- Enter Domain. As a source of content, you can use a container in the cloud storage or your web server, which is specified by a domain name or IP address. CDN downloads files directly from the main server by contacting it by domain or IP address, which is indicated as the source. It is recommended to use a domain name instead of an IP address, as this is a more convenient and universal approach. Only one container in the cloud storage can be used as a source. You can add multiple domains after creating a CDN resource.
- If necessary, change the Port. If a content source uses a non-standard port (standard ports are 80 and 443), you can enter the custom port used.
- A «personal domain» for content distribution can be specified after creating a CDN resource.
- Click Create CDN resource.
The Akamai CDN can currently only be enabled and configured manually. After entering resource parameters, a request is automatically sent to technical support. Further CDN resource parameters are set via ticket system.
Consumption statistics can be viewed on the Consumption tab.
Configuring CDN Resources
Open the settings of a CDN resource by clicking on the resource block.
After creating the CDN resource, a «default domain» of the form .Selcdn.net or. Akamaized.net will be generated, depending on the selected provider. You can see the «default domain» on the Domains tab.
Through the «default domain» content is distributed via https. For example, on the main server (content source), in the «photos» folder there is a cat.jpg file. In order to distribute this file via CDN, you can use an address of the form ***. Selcdn.net/photos/cat.jpg.
In addition to distributing through the «default domain», it is possible to connect a «personal domain» and distribute files through it.
To add a «personal domain» in the CDN-resource card, go to the Domains tab, click the Connect domain and enter the domain name.
Note: you can use at least third level domains as «personal domain».
To activate the «personal domain», create a CNAME record at your DNS provider.
The «default domain» is covered by the General Certificate and distribution is carried out using the https protocol.
You can only upload your SSL certificate for the Selectel CDN resource.
At the moment of connecting your own SSL Certificate, content distribution through the default domain» will begin using the http-protocol, since only one certificate can be active at a time.
Akamai cannot use its own certificates.
Adding Multiple Content Origins
If you select your web server as the content source, you can add additional content sources. For this:
- Click Edit origin.
- Enter Domain and Port domain connection.
- Save your changes.
Host header — this is the header that CDN servers use when requesting content from a source. It allows you to configure the flexible delivery of content depending on the value of the header.
The content source server should allow requests with the specified header. Initially, the title matches the «default domain».
To verify that the title is correct, enter the command: ‘curl -I -H “Host:cdn.site.com” https://origin.site.com ‘ where cdn.site.com — header, which is indicated in Host header, https://site.ru — domain or original IP.
Verify that the server can handle the specified header.