What is the CDN resource used for?
A CDN resource is a feature that allows you to accelerate and protect the entire site with CDN and DNS services. This CDN resource helps accelerate both kinds of content delivery: static and dynamic. If you only need to deliver static assets, use a separate CDN resource for static content.
You can create up to 30 CDN resources in one account by default. Contact our support team if you need more CDN resources.
1. In the "CDN" section, click "Create CDN resource".
2. Set up an initial configuration of your CDN resource.
Description (optional). You can add an internal comment about the CDN resource. It will not affect any setting, but it will be only displayed in the "CDN resources" section next to the resource CNAME.
Origin. An origin is a source (e.g., a website, an application, a private bucket) from where the CDN resource will request the content. In the ALTERNcloud CDN control panel, each origin is allocated to an origin group.
- If you didn’t create the origin group, choose the Specify content origin option and follow our instructions to add an origin group (step 2).
- If you created the origin group previously, choose the Select origins group option, click on the field, and select the required origin group.
Custom domain. Create a custom domain as cdn.[your website domain] for delivering static files via the CDN. For example, if your website is yourdomain.com, enter cdn.yourdomain.com. Dynamic content will be sent to users from yourdomain.com, while static files will be delivered from cdn.yourdomain.com. You can specify multiple domains in one go by clicking the "+" icon. Later in Step 4, you can configure your website to deliver different types of static files from separate domains. Please note that a custom domain such as cdn.yourdomain.com cannot be changed after creating a CDN resource.
SSL. If you want to make your static files accessible over HTTPS, toggle on the "Enable HTTPS" feature. Choose one of two options: "Get free Let's Encrypt certificate" or "Add or select your own SSL certificate". When choosing the first one, an SSL certificate will be issued automatically for a domain of your CDN resource (cdn.yourdomain.com) after Step 3 of this instruction. If you select the second option, you can add your own certificate using the instruction Add an SSL certificate to transfer content over HTTPS.
3. Add a CNAME record for the domain that you specified in Step 2 as cdn.yourdomain.com. You need to do it in your DNS provider's personal account. For a CNAME value, enter a subdomain shown in your ALTERNcloud CDN personal account as *.gcdn.co. For example, in the screenshot below it is written as cl-gl870a2bea.alterncloud.co, so, for the cdn.yourdomain.com subdomain, you need to create a CNAME record with the value cl-gl870a2bea.alterncloud.co.
If you specified additional domain names in Step 3, create CNAME records for them with the same value as well.
4. In the path of static files, replace the source domain with a custom domain of the CDN resource. For example, if a file path used to be yourdomain.com/images/image.jpg, change it to cdn.yourdomain.com/images/image.jpg. As a result, users will receive static files from the CDN cache, and only the requests to the files that haven't yet been cashed will be forwarded to your origin server.
- If your site is built on a CMS (WordPress, Joomla, Drupal or other), you can replace a domain name in file paths using special plugins. You can find a necessary plugin and instructions for replacing the URLs in the "CMS Integration" section.
- If your site is not built on a CMS, replace a domain name in the URLs of static files manually.
5. Optionally, you can activate additional features for your CDN resource. You can skip this step; you'll always be able to return to additional settings later.
Click "Confirm" to complete the creation and set-up of your CDN resource.
The resource will be created automatically. You will see a page with its advanced settings. If there is no text box ... steps left
in the upper-right corner, everything is ok and the resource is working.
If you see the ... steps left
text box, it means that something went wrong while creating or integrating the CDN resource.
To find out exactly where an error occurred, click the "Setup guide" button at the top. You will see a sliding panel indicating the status of each step of CDN resource creation.
If a step is configured correctly, it will be shown in the UI.
If an error occurs, a corresponding message will appear.
In case of an error, go back to the instruction above and perform the necessary step again.