API
The Gcore Customer Portal is being updated. Screenshots may not show the current version.
CDN
CDN
BillingCDN resources overviewOrigin groupPurgePrefetchReports
API
Chosen image
Home/CDN/Getting Started/Create a CDN resource/For static files

Create a CDN resource for static assets only

Step 1. Start creation

Go to the CDN page and click Create CDN resource.

Create CDN resource button

Step 2. Choose acceleration type

Select Accelerate and protect only static files on the open page, then click Confirm.

Acceleration and protection type

Step 3. Set up the initial configuration

Initial configuration

Fill in the fields to configure your CDN resource on the open page.

1. (Optional) Add Description. Enter an internal comment about the CDN resource. This will not affect any settings but will only be displayed in the CDN resources section next to the resource CNAME.

2. Configure the 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 Gcore customer portal, each origin is allocated to an origins group.

There are two options for the Origin:

  • Specify content origin—Select this option if you haven't previously created an Origin Group. Follow our instructions to add an origin group (step 4).
  • Select origins group—Select this option if you already created the necessary Origin Group. Click the “Select the Origin Group” field, and select the required Origin Group.

3. Specify the Custom domain. Assign a custom domain as cdn.[your website domain] for delivering static files via CDN. For example, if your website is yourwebsite.com, enter cdn.yourwebsite.com. Dynamic content will be sent to users from yourwebsite.com, while static files will be delivered from cdn.yourwebsite.com.

You can specify multiple domains by clicking the "+" icon. In Step 5, 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.

4. Click Confirm.

Step 4. Set up DNS (add CNAME)

Add a CNAME record for the domain specified in Step 3 as cdn.yourwebsite.com. Do so in your DNS provider's personal account. For a CNAME value, enter a subdomain shown in your Gcore customer portal as *.gcdn.co.

For example, in the screenshot below the subdomain is cl-1ab23456.gcdn.co, so, for the cdn.yourdomain.com subdomain, you need to create a CNAME record with the value cl-1ab23456.gcdn.co.

DNS setting

If you specified additional domain names in Step 3, create CNAME records for them with the same value.

Step 5. Integrate the CDN resource with your website

1. Go to the admin panel of your origin website and change the URLs of static files.

Replace the Origin Source domain with a custom domain of the CDN resource either by script or manually. For example, if a file path used to be yourwebsite.com/images/image.jpg, change it to cdn.yourwebsite.com/images/image.jpg. As a result, users will get static files from the CDN cache, and only the requests to the files that haven't yet been cached will be forwarded to your origin server.

If your site is built on a CMS (such as WordPress, Joomla, or Drupal) you can replace a domain name in file paths using special plugins. Find the right plugin and discover instructions for replacing the URLs in our guide on integrating CDN with CMS

2. Go back to the Gcore Customer Portal and click Confirm.

Integration

That’s it! The CDN resource creation is completed. You will be redirected to the CDN resource settings, where you can configure advanced settings.

If there is no text ... steps left box in the upper-right corner, everything is ok, and the resource is working.

Issues with the creation

If you see the ... steps left box, something went wrong while creating or integrating the CDN resource.

Issues

To find out exactly where an error occurred:

1. Click Setup guide.

You will see a sliding panel indicating the status of each step of CDN resource creation.

2. Click Check DNS setup status.

Check DNS setup
  • If a CNAME record is configured correctly, it will be shown in the UI:
Configured correctly
  • If an error occurs, a corresponding message will appear.
Error message

3. Click Next in the “Setup your DNS section.” Click Check your integration.

Check your integration

If there are integration issues, you will see an error message. Contact support team or retry the integration according to our instructions.

Was this article helpful?

Not a Gcore user yet?

Learn more about our next-gen CDN

Go to the product page