The Origin pull protocol and Pull content from settings control how CDN servers fetch content from the origin. Both options are in the General section of the CDN resource settings.
Origin pull protocol
In the CDB Technical Web Portal, navigate to CDN > Resources and click the resource name. Open the OPTIONS tab and scroll to the General section.
Use the Origin pull protocol option to set the protocol that CDN servers use to pull content from an origin server: HTTP, HTTPS, or HTTP and HTTPS.
Select the origin pull protocol based on the protocol supported by the origin server:
HTTP — if the content on the origin server is available only via HTTP (port 80) or there is a redirect from HTTPS to HTTP on the origin server.
HTTPS — if the content on the origin server is available only via HTTPS (port 443) or there is a redirect from HTTP to HTTPS on the origin server.
HTTP and HTTPS — if the content on the origin server is available via both HTTPS and HTTP. A CDN server uses the protocol that matches the client's request:
Files are cached for both protocols. There are two versions of the file in the cache: one for HTTP and one for HTTPS.
When a user sends a request to https://cdn.example.com/image.jpg, the CDN pulls from the origin through HTTPS (port 443).
When a user sends a request to http://cdn.example.com/image.jpg, the CDN pulls from the origin through HTTP (port 80).
To understand the effect of an incorrect value, consider this example:
The origin server delivers content only through HTTPS (port 443), but Origin pull protocol is set to HTTP.
Origin redirects from HTTP to HTTPS
A user requests content at http://cdn.example.com/image.jpg.
The CDN pulls from the origin at http://example.com/image.jpg.
The origin redirects to https://example.com/image.jpg.
Conclusion: the user gets content from the origin, not from the CDN. Set the protocol to HTTPS to have content delivered through the CDN.
Origin does not redirect from HTTP to HTTPS
A user requests content at http://cdn.example.com/image.jpg.
The CDN pulls from the origin at http://example.com/image.jpg.
Conclusion: the origin cannot provide content because it only accepts https://example.com/image.jpg. Set the protocol to HTTPS to have content delivered through the CDN.
Pull content from
Use the Pull content from section to specify the origin group that the CDN uses to pull content. The origin can be an IP address or a domain name.
To change the current origin group, click Edit this group.
To add a new origin group, click Add group. After the group is created, select it from the origin group dropdown — it is not assigned to the resource automatically.
Set the protocol CDN servers use to pull content from the origin, and assign the origin group that supplies that content.
ℹ️
An API token is required. The CDN resource ID is visible under CDN → CDN Resources, or from the resources list call.
HTTP — CDN servers pull from the origin over HTTP.
HTTPS — CDN servers pull from the origin over HTTPS.
MATCH — the CDN uses the client request protocol. HTTP and HTTPS responses are cached separately.
Choose a protocol the origin accepts. If the CDN pulls over HTTP while the origin only serves HTTPS, the request may be redirected or fail, depending on the origin configuration.
Open a terminal and export the required variables:
Set the origin pull protocol and the origin group on a CDN resource with the Terraform provider v2.
Set the origin pull protocol
The origin hostname must resolve in DNS. origin_protocol accepts HTTP, HTTPS, and MATCH. MATCH is the HTTP and HTTPS option: the CDN pulls with the protocol of the client request, and HTTP and HTTPS responses are cached separately. Set origin_protocol to HTTP when the origin accepts only HTTP. Edit the value and run terraform apply to change the protocol in place.
The CDN resource uses the origin group referenced by origin_group. Adding another origin group leaves the resource on its current group. Point origin_group at the group that should serve content and run terraform apply. That apply prints an error that origin_group_name changed. The next terraform plan shows no differences, and the resource uses the referenced group.
Remove the resource blocks. The next terraform apply deletes the CDN resource and every origin group the resource does not reference, then the origin group referenced by origin_group.