This guide will explain the origin groups feature and show you how to configure and add an origin group to your CDN resource.
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.
You can do this in several ways: during CDN resource creation, in the settings of an existing resource, or on the Origin groups page.
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.
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.
Enter a unique name of a group.
You can choose the AWS signature V4 origin authentication or select None for the public origins without 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.
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.
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.
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.
When you have more than one origin in a group, you can adjust the balance between them. To do so:
Select which origins to enable and disable.
Select active and backup origins.
Decide whether to enable the Use next upstream option.
Each origin has the On toggle enabled by default. This means that CDN can pull content from this origin and it has been added to the balance.
If you want to disable the content origin in the group, disable the toggle so it changes to Off. Note that this will only disable the origin in the current group, but the origin will continue to work in other groups.
CDN requests will stop coming to the disabled origin within fifteen minutes.
You can’t disable the last active origin.
All new origins are automatically assigned an Active status. The CDN pulls content from such origins. The balancing between them is determined by the round-robin algorithm.
You can turn the active origin into the backup origin by selecting the Use origin as a backup option.
Backup origins are taken out of balance by default. The CDN requests content from them only if the active origin gives a 5xx response code.
This option only works if each origin has the same content. When enabled, the CDN will call the following origins on the list if the previous one is unavailable and respond with any 4xx or 5xx series response code.
Code 400 is an exception. In this case, the CDN won’t redirect requests to another source. If all origins are unavailable, the CDN will show the response of the last one in the list.
At first glance, the interaction between the active/backup origins and the Use next upstream option may seem complicated, so to make it easier to understand, let’s look at examples of how it works.
Case | How the CDN requests content |
The "Use next upstream" option is disabled; all origins are active. | If the active origin responds with an error, the CDN will hand it off to the end user. |
The "Use next upstream" option is enabled. One origin is active, and the rest are backups. | If the active origin responds with 4xx and 5xx response codes, the CDN will start requesting content from the other origins, moving down the list. |
The "Use next upstream" option is enabled. All origins are active. | If the first active origin responds with 404, 500, 502, 503, or 504 response codes, the CDN will start requesting content from the other origins, moving down the list. |
The "Use next upstream" option is disabled. One origin is active, and the rest are backups. | If the active origin doesn’t respond within 5 seconds or responds with a 5xx response code, the CDN will request content from the backup origin. If the active origin responds with a 4xx response code, the CDN won’t request the backup origin and will send an error message to the user. |
Click Add group to save changes.
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.
Was this article helpful?
Learn more about our next-gen CDN