Set Origins

Last update:2024-05-14 15:57:05

You can configure either Basic Origin or Advanced Origin as needed:

  • Basic Origin: You can set the back-to-origin by the origin domain/IP.
  • Advanced Origin: This routes traffic to distinct origins based on the region/ISP, or employs a weighted round-robin to alternate among multiple origins.

How to Set Basic Origin

  1. Log in to the CDNetworks Console, and select the appropriate product.
  2. Navigate to the Configuration, locate the domain you wish to configure, and click image.png
  3. You can configure the following settings based on your needs.


Basic Origin Type

  • Back-to-Origin IP/Domain: Allow to set back-to-origin IP addresses or domain, support multiple IPs (up to 500 characters) or 1 domain.
  • WCS Back-to-Origin Domain: If you are using CDNetworks’ Object Storage service, you can designate your Object Storage as the origin by selecting WCS Back-to-Origin Domain. Upon selection, a drop-down box of domains will appear that point to different buckets in your object storage, that is, you can specify a specific bucket as origin by selecting the corresponding domain in the drop-down box.


Back-to-Origin IP/Domain
Can only fill in either back-to-origin IP or domain.

  • If entering back-to-origin IPs, up to 64 IPs can be entered, separated by ;.
  • If entering a back-to-origin domain name, only 1 domain name can be entered.

Back-to-Origin Request HOST
The Host header is a mandatory field in an HTTP request that specifies the hostname or domain of the server the client wishes to communicate with. It’s necessary because multiple domains can share the same IP address on a server, and the origin uses this value to determine what content to send. After configuration, when there is a client request carrying Host value, the origin will respond content related with the hostname or domain.
For example, if the value is set at www.cdnetworks.net, an end-user request for www.testdomain.com could send www.cdnetworks.net in the Host header to the origin. Then the origin will respond with www.cdnetworks.net related content.

Back-to-Origin Request Port
It allows you to override the destination port on your origin server you want CDN servers to request to.
For example, if the port value is set as 9000 for your domain cdnetworks.com, when receiving a request for cdnetworks.com, CDN servers connect to origin wth port 9000(cdnetworks.com:9000).

If no port is configured, the original request’s port is followed for back-to-origin.
If an advanced origin is configured and you need to change the port back to the advanced origin, please contact CDNetworks technical support.

How to Set Advanced Origin

  1. Log in to the CDNetworks Console, and select the appropriate product.
  2. Navigate to the Configuration, locate the domain you wish to configure, and click image.png.
  3. Find the Advanced Origin button, which is off by default, click the button to enable advanced origin.
  4. Click Add to add advanced origin configuration rules.


Region/ISP
Indicates that users belonging to this region/ISP use this advanced origin rule when requesting back-to-origin.

When configuring Region/ISP, please ensure that at least one advanced origin rule includes a region of Global; otherwise, the configuration cannot be submitted.
While setting the rules, please note that the granularity of available regions differs. Within China, you can select specific ISPs, but outside of China, you can only choose the applicable country.

Advanced Origin Mode
There are below 2 modes for advanced origin, but you only see 1 non-editable mode, that is because Console already set the default mode for each product and this configuration cannot be changed directly through the console. To modify advanced origin settings, please contact the CDNetworks technical support for assistance.

  • Intelligent Back-to-Origin Detection: In this mode, when multiple origin servers are available, the CDN edge server uses an intelligent detection algorithm to choose the optimal origin server for traffic.
  • Weighted Back-to-Origin: This mode assigns different weight values to each origin server. When request to origin, the CDN edge server will poll the origin servers proportionally based on their assigned weights, ensuring traffic is distributed according to the preset weight ratios.

Advanced Origin

  • Level
    This setting defines the priority order of origin servers, the lower the level number, the higher the priority. For example, Level 1 represents the primary origin, Level 2 is the primary orgin’s backup, and Level 3 is the primary backup’s backup. The CDN will prioritize accessing Level 1 origins first and, if they are unavailable, will proceed to Level 2, and so forth. Multiple origin servers can share the same Level, but each Back-to-Origin IP/Domain field contains only one IP or domain. To add more origin servers, click Add to include additional origin IPs or domains.

  • Weight
    This setting assigns weight values to origin servers within the same Level. The CDN edge server will distribute traffic among these origin servers according to their assigned weights, ensuring traffic is allocated proportionally. In Intelligent Back-to-Origin Detection mode, weight configuration is NOT applicable since the CDN edge server will always choose the best origin server based on the intelligent algorithm. However, if Primary Origin Round-Robin/Backup Origin Round-Robin is enabled in Advanced Config, the traffic will be routed based on weight, overriding the intelligent algorithm.

  • Source Host
    Also known as the Host Header, which allows you to specify different back-to-origin hosts for each origin domain or IP address, ensuring that the CDN edge server includes the appropriate host header in its back-to-origin requests. This setting applies only to Weighted Back-to-Origin mode and is unavailable in Intelligent Back-to-Origin Detection mode.

Advanced Config

  • Enable Offline Mode: When Offline Mode is enabled, the CDN will strictly follow the advanced origin configurations for fetching content. If the advanced origins are unavailable, the system will enter Offline Mode, during which CDN edge servers will respond based on cached resource.
  • Primary Origin Round-Robin: When Primary Origin Round-Robin is enabled, if multiple primary origins (those with the lowest Level value) exist, the CDN edge servers will distribute traffic among these primary origins based on their assigned weights, even in Intelligent Detection Back-to-Origin mode. This method enforces the use of weights instead of the intelligent detection algorithm.
  • Backup Origin Round-Robin: Similar to Primary Origin Round-Robin When Backup Origin Round-Robin is enabled, if multiple backup origins (those NOT with the lowest Level value) exist, the CDN edge servers will distribute traffic to these backup origins based on their assigned weights, bypassing the intelligent detection algorithm, even in Intelligent Detection Back-to-Origin mode.

After you have completed setting the configurations, please click OK and then select Next to submit your settings. To minimize any potential disruptions to your production environment, we strongly recommend conducting a Pre-deploy test in a staging environment. This crucial step ensures that your configurations are accurate before they go live. Once you have verified the accuracy of the settings, click Deploy Now to implement them in the live environment. The configurations typically become effective within 3-5 minutes. For comprehensive guidance on pre-deployment testing and to verify the effectiveness of your configurations, please consult the tutorial Deploy the Configurations to Staging Environment for Validation.

Best Practices

Example 1: Weighted Back-to-Origin
1.1.1.1 and 2.2.2.2 are primary origins, 3.3.3.3 is a secondary origins. Preferentially back to primary origins, 1.1.1.1 and 2.2.2.2 are polled at a ratio of 3:7. When primary origins are unavailable, then back to the secondary origin.


Example 2: Intelligent Back-to-Origin Detection
1.1.1.1 and 2.2.2.2 are primary origins, 3.3.3.3 is a secondary origin. Preferentially back to primary origins, 1.1.1.1 and 2.2.2.2 are chosen based on CDNetworks intelligent detection results (not by weight). When primary origins are unavailable, then back to the secondary origin.


Example 3: Intelligent Back-to-Origin Detection + Primary/Backup Origin Round-Robin
1.1.1.1 and 2.2.2.2 are primary origins, 3.3.3.3 is a secondary origin. Preferentially back to primary origins, 1.1.1.1 and 2.2.2.2 are polled at a ratio of 7:3. When primary origins are unavailable, then back to the secondary origin. Here, intelligent detection results are only used to choose the optimal path among CDN nodes.


Notes

  • Advanced origin configuration takes precedence over basic origin configuration. For example, the effect of the following configuration is to preferentially back to 1.1.1.1, and if back-to-origin fails, then back to 2.2.2.2.


  • When backing to advanced origin, the client’s request port is used for back-to-origin by default. If you need to change the back-to-origin port for advanced origin, please contact CDNetworks technical support.
  • If there are overlapping regions in the configured rules, the smallest granularity region is prioritized. For example, the effect of the following configuration is that, when China Telecom users back-to-origin, preferentially back to 3.3.3.3, and if back-to-origin fails, then back to 2.2.2.2, and finally back to 1.1.1.1.


Is the content of this document helpful to you?
Yes
I have suggestion
Submitted successfully! Thank you very much for your feedback, we will continue to strive to do better!