Add an origin group to a CDN resource
This guide will explain the origin groups feature and show you how to configure and add an origin group to your CDN resource.
What is the origin groups feature?
Origin groups is a feature that allows you to specify sources for a CDN resource. One origin group can consist of a single site/private bucket or of multiple sites.
Specifying several sites increases fault tolerance. If one origin fails, another can function as a backup. You can specify a group and set the logic of interaction between origins.
For example, if you make both origins in the group active, requests between them will be distributed 50:50. If you make one source the backup, then that source will respond only when the primary source gives an error 5xx.
Step 1. Add a new origin group
You can do this in several ways: during CDN resource creation, in the settings of an existing resource, or on the Origin groups page.
In resource settings
1. In the Gcore Customer Portal, navigate to CDN. You’ll be directed to the CDN resources page.
2. Find the resource where you want to add a new origin group and click the CNAME to open its settings.
3. Scroll down to the Origin pull protocol section.
4. Click Add group and proceed with the configuration as described in Step 2.
On the origin groups page
If you add a group from the Origin groups page, the created group won’t be automatically added to a CDN resource. You’ll need to manually add a group to the resource.
1. In the Gcore Customer Portal, navigate to CDN > Origin groups.
2. Click Add origin group and proceed with the configuration as described in Step 2.
Step 2. Enter the origin group name
Enter a unique name of a group.
Step 3. Configure the origin group
You can choose the AWS signature V4 origin authentication or select None for the public origins without authentication.
With S3 authentication
If you selected AWS signature authentication, choose your storage type and proceed with the relevant instructions.
You can configure any S3-compatible storage, such as Google Cloud Platform, DigitalOcean Spaces, or Azure Blob Storage.
Amazon S3 storage
1. Specify your access key ID. In your Amazon personal account, it’s called “AWS access key ID”. For details on how to find your key ID, check the official Amazon guide.
2. Specify your secret access key. In your Amazon account, it’s called “AWS secret access key”. For details on how to find your access key, check the official Amazon guide.
3. Choose your AWS region—the location of a server where your storage is hosted.
4. Enter your S3 bucket name.
Other S3 storage
1. Specify a hostname—a name that’s assigned to a storage server within a network and is used instead of an IP address.
2. Specify your access key ID.
3. Specify your secret access key.
4. Specify a region—location ID of a server where your storage is hosted.
5. Enter your S3 bucket name.
With no authentication
1. In the origin source field, enter the origin IP or its domain name without http
or https://
. The CDN will pull content from this source.
2. (Optional) If your source uses ports other than 80 or 443, disable the Use default port toggle and enter the port on the right.
3. (Optional) If you want to use several sources of content, click +Add origin and enter the value. The CDN will determine the origin IPs as separate sources and distribute requests to them according to the round robin algorithm. In other words, the first request will go to the first source, the second request will go to the second source, and so on.
Step 4. Save changes
Click Add group to save changes.
Step 5. Connect the origin group to the CDN resource
Info
If you change an origin group for a CDN resource, the Host header will not automatically change. You’ll have to update it manually.
To add a created group to the CDN resource:
1. In the Gcore Customer Portal, navigate to CDN. You’ll be directed to the CDN resources page.
2. Find the resource where you want to add a new origin group and click the CNAME to open its settings.
3. Navigate to the Origin section.
4. Choose the relevant group from the Origin group dropdown and click Add group.
5. Click Save changes.