Allow Conditional Origins

With cloudlets like API Prioritization, Forward Rewrite, Phased Release, and EdgeWorkers, you can forward a request to a different origin. If you wish to use an alternate origin when forwarding requests, use the Conditional Origins rule templates.

How it works

Within the Conditional Origins rule template, there are two distinct rules:

  • Conditional Origin Group rule. Used to enable Conditional Origins for the property. This rule contains child rules for defining each Conditional Origin within your configuration.
  • Conditional Origin Definition rule. Contains the configuration details for a single Conditional Origin.
    If you're adding Conditional Origins to your configuration, add them before you set up policies in Cloudlets Policy Manager and set up the supporting cloudlets behavior in Property Manager.

You may also want to set up a CP codes match or a purge rule specifically for your Conditional Origins. See the Cloudlets documentation for more information.

Conditional Origin Group rule

The Conditional Origin Group rule:

  • lets you enable Conditional Origins for the property.
  • must be the last child rule of the property’s Default Rule. You cannot have multiple Conditional Origin Group rules within a property.
  • includes, by default, two Conditional Origin Definition child rules.
  • is flexible. You can add more Conditional Origin Definition child rules if needed.

Set up a Conditional Origin Group rule

📘

You cannot have multiple Conditional Origin Group rules within a property.

  1. Select the property you're adding Conditional Origins to.
  2. Select the version of the property configuration you want to edit.
  3. On the Edit tab of the property configuration, select Default Rule and click Add Rule.
  4. Select Conditional Origin Group from the list of available rule templates.
  5. Click Insert Rule.
    A new Conditional Origin Group rule displays at the bottom of the list of child rules for the Default Rule.
  6. In the Criteria section for the rule, click Add Match to select the type of match that will trigger this Conditional Origin.
  7. In the Allow Conditional Origins behavior, complete these fields:
FieldDescription
EnableSelect to enable Conditional Origins for this property.
Honor Origin Base PathEnable to prefix the Conditional Origin path to the path defined by an Origin Base Path behavior. If the request doesn't include an Origin Base Path behavior, this setting has no effect.
If a Cloudlet already modifies the path by prepending the same Origin Base Path, it doesn't duplicate the path segment.
Origin Purge Query ParameterEnter the query parameter to use when purging cache content from a Conditional Origin. When this query parameter is present in a purge request, the specified Conditional Origin will be purged. The default query parameter is originId. You define the originId in the Conditional Origin Definition rule.
  1. Continue with setting up Conditional Origin Definition rule.

Conditional Origin Definition rule

  • The Conditional Origin Definition rule is used for defining the origins available for use with Cloudlets.
  • Within a Conditional Origin Definition rule, you set up the specific configuration for an origin to be used with Cloudlets.
  • Although the Conditional Origin Definition rule template includes an Origin Server behavior and a Content Provider behavior by default, only the Origin Server behavior is required.
  • If you are setting up a NetStorage origin, a Caching behavior is also required.
  • You can also add other behaviors to the Conditional Origin Definition rule. Any behavior added to this rule will only execute if a Cloudlet selects this Conditional Origin.
  • When adding this rule to a property, it must be a child rule of the Conditional Origin Group rule.

Setting up a Conditional Origin Definition rule

🚧

When adding this rule to a property, it must be a child of the Conditional Origin Group rule.

  1. Verify that the Conditional Origin Group rule is already configured.
  2. From the Conditional Origin Group rule, click on the first Conditional Origin Definition rule.
  3. In the Criteria section for the rule, enter a Conditional Origin ID containing alphanumeric and underscore characters.
  4. Set up the Origin Server behavior.
    Conditional Origins only support the Your Origin and NetStorage origin types. If using a NetStorage origin, you'll need to add the Caching behavior.
  5. Add any other behaviors that apply to this new Conditional Origin.
  6. Change the rule name to reflect the function of this Conditional Origin by clicking the action cog in the rule and selecting Edit Name.
  7. At the bottom of the rule section, click Save.
  8. Repeat the previous steps to set up additional Conditional Origins. You may need to add another Conditional Origin Definition child rule to the Conditional Origin Group rule.
  9. Complete any additional updates to the property and save your changes.
  10. Activate the property.
  11. Test your configuration.
    Testing is especially important if another rule within the property contains a behavior that modifies the origin. This type of behavior may be applied to your Conditional Origin.

Features and options

FieldWhat it does
EnableEnables or disables this behavior.
Honor Origin Base PathIf enabled, prefixes any Cloudlet-generated origin path with a path defined by the Origin Base Path behavior. If no path is defined, it has no effect. If another Cloudlet policy already prepends the same Origin Base Path, the path isn't duplicated.
Origin Purge Query ParameterWhen purging content from a Cloudlets Origin, this specifies a query parameter name whose value is the specific named origin to purge. Note that this only applies to content purge requests, for example when using the Enhanced Content Control Utility API.