Skip to main content

CDN: quick start

Last update:

You can work with the SDN in the control panel.

  1. Create a CDN resource.
  2. Optional: connect a personalized domain.
  3. Check the operation of the CDN resource.

1. Create a CDN resource

A CDN resource is a set of settings that define how content will flow from the source to the CDN servers and be sent from the CDN servers to end users.

As a content source, you can specify:

  • your source using the domain or IP address of the site;
  • or baquet S3.
  1. In the Control Panel, on the top menu, click Products and select CDN.

  2. Click Create CDN resource.

  3. Enter a name for the resource. The name has no effect on the resource settings and is used only for operation in the control panel.

  4. In the Content Source field, select Own Source.

  5. In the Domain or IP Address field, enter the IP address or domain of your site.

  6. Click Create CDN Resource. When you create a CDN resource, a default domain is automatically generated. The files that will be distributed by the CDN server will be opened using a link of the form *.selcdn.net.
    You can leave the default domain or connect a personalized domain.

2. Optional: add a personal domain to the resource

We recommend distributing content through a personal domain. The use of third-party domains can make it difficult to promote the site and affect the order in the search engine.

  1. Register a domain.
  2. Create a CNAME record in DNS hosting.
  3. Add a personalized domain in the control panel.
  4. Add an SSL certificate to the CDN resource.
  5. Replace the domain in the links on the site.

1. Register a domain

If you don't already have a domain that you want to use as a personal domain, register it. You can register a domain with Selectel.

If you already have a domain, go to the next step.

2. Create a CNAME record in DNS hosting

Only a subdomain for the main domain can be used as a personal domain, e.g. cdn.example.com for example.com. You cannot use the main domain as a personal domain.

  1. Open the domain settings:

    • if you have delegated a domain to Selectel, go to the Selectel control panel: in the top menu, click ProductsDNS hostingDomain zones section;
    • if the domain is managed in another DNS hosting, open the control panel of this DNS hosting.
  2. Create a resource record. Specify:

    • record type is CNAME;

    • record name is a subdomain of the form cdn.example.com;

    • value - default domain of the form *.selcdn.net. Specify a domain without protocol, for example cdn.example.com. Allowed length of each level of the domain - 63 characters. The length of all levels must not exceed 253 characters.

      You can view the default domain in the Control Panel: in the top menu, click ProductsCDNCDN Resources section → the domain will be listed in the resource bar.

3. Add a personal domain in the control panel

  1. In the Control Panel, on the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the resource page → Main tab.

  3. In the Personal Domain block, click Add Personal Domain.

  4. Specify the personal domain for which you configured the record.

  5. Click Apply.

4. Add an SSL certificate to the resource

  1. In the Control Panel, on the top menu, click Products and select CDN.

  2. Go to Certificates for CDN resources.

  3. If you want to issue a Let's Encrypt certificate:

    3.1 On the menu, click Issue Let's Encrypt Certificate.

    3.2 Select the CDN resource for which you want to issue a certificate.

    3.3 Click Release.

  4. If you want to download a personalized certificate:

    4.1 From the menu, click Upload Personal Certificate.

    4.2 Specify a name for the certificate. It will be used only in the control panel.

    4.3 Add a certificate for the domain. It must start with -----BEGIN CERTIFICATE----- and end with -----END CERTIFICATE-----.

    If you want to add multiple certificates, make sure that all certificates (the primary certificate for the domain, intermediate certificates, and the root certificate) create a complete chain. The Issuer value of the primary certificate must match the Subject value of the first intermediate certificate, the Issuer value of the first intermediate certificate must match the Subject of the second intermediate certificate, and so on.

    4.4 Add a private key. It must start with -----BEGIN PRIVATE KEY----- and end with -----END PRIVATE KEY-----.

    4.5. Click Upload.

  5. Go to the CDN Resources section.

  6. Open the CDN resource page → Certificates tab.

  7. Check the Distribute over HTTPS via CNAME checkbox.

  8. In the Certificate field, select the certificate that you issued in step 3 or uploaded in step 4.

  9. Click Apply. The resource will be in PROCESSING status while the settings are being applied . You cannot apply any other settings at this time. The settings will be applied when the share changes to ACTIVE status.

    You can view certificate information in the control panel: in the top menu, click Products and select CDNCDN resources → resource page → Certificates tab.

If you selected your own content source when you created the resource in step 1, replace the domain in the URL of the static site files with the personal domain of the form cdn.example.com that you specified in step 3 when you created the CNAME record in step 2:

If the site is on a CMS, use a URL replacement plugin, if not, replace the URL in the site code.

3. Check the operation of the CDN resource

  1. Wait until the CDN resource starts working - it will go to the ACTIVE status.

  2. Open the file that the CDN should give you from the link on your site. Example link: example.com/images/image.png. If the file does not open, check the site's operation.

  3. Open the file through the default domain using the link. Example link: *.selcdn.net/images/image.png. If the file does not open, check the CDN resource and Host header settings.

  4. If you added a personal domain in step 2, open the file through the personal domain using the link. Example link: cdn.example.com/images/image.png. If the file does not open, verify that the CNAME record you created in step 2 is correct.