# Advanced Origin Settings

Advanced Origin Settings allow you to configure granular origin-routing behavior for specific URIs, file types, or directories. By defining rule-based conditions, you can route selected traffic to different origins, override ports, set custom host headers, or assign priorities for complex routing environments.

You can manage Advanced Origin Settings in the [Medianova Control Panel](https://cloud.medianova.com) or via [API](https://clients.medianova.com/api-documentation/performance-cdn/origin-settings).

Log in to the Medianova Control Panel, select a CDN resource in the CDN section, and navigate to the **Origin Settings** tab.

Advanced Origin Settings use rule-based logic. Each rule defines **what request pattern to match** and **how the CDN should route that traffic**.

## Add an Origin Rule

This workflow creates a new rule for routing selected requests to a specific origin configuration.

{% stepper %}
{% step %}
**Open the Add Rule Dialog**

Select **Add** in the Advanced Origin Settings section to create a new routing rule.
{% endstep %}

{% step %}
**Select the URI Match Mode**

Choose whether the rule should match an **Exact Path**, **Prefix**, **File Extension**, or **Regex** pattern.
{% endstep %}

{% step %}
**Define the URI Match Rule**

Enter the URI, directory, extension, or expression that determines which requests will use this origin rule.
{% endstep %}

{% step %}
**Select the Protocol**

Choose whether the CDN forwards requests using **HTTP**, **HTTPS**, or **Same as Request**.
{% endstep %}

{% step %}
**Enter the Domain or IP**

Specify the origin host that the CDN should forward matched traffic to.
{% endstep %}

{% step %}
**Configure HTTP and HTTPS Ports**

Enter the port numbers the CDN should use when communicating with the origin.
{% endstep %}

{% step %}
**Set the Host Header**

Define a custom **Host** header if the origin requires a different hostname than the request URL.
{% endstep %}

{% step %}
**Assign Priority**

Choose a priority value to control which rule applies if multiple rules match the same request.
{% endstep %}

{% step %}
**Save the Rule**

Select **Add** to save the rule to the rule list.
{% endstep %}

{% step %}
**Submit the Configuration**

Click **Submit** to apply all rule changes to the CDN resource.
{% endstep %}
{% endstepper %}

## Edit an Origin Rule

{% stepper %}
{% step %}
**Select the Rule To Edit**

Choose an existing rule from the list in the Advanced Origin Settings section.
{% endstep %}

{% step %}
**Modify the Required Fields**

Update match conditions, origin host, ports, or priority values.
{% endstep %}

{% step %}
**Save the Updated Rule**

Click **Submit** to apply the updated configuration.
{% endstep %}
{% endstepper %}

## Delete an Origin Rule

{% stepper %}
{% step %}
**Remove the Rule**

Select the delete icon next to the rule you want to remove.
{% endstep %}

{% step %}
**Confirm Deletion**

Submit the change to finalize the removal.
{% endstep %}
{% endstepper %}

## Behaviour

Advanced Origin Settings follow a priority-based evaluation model:

* **Highest priority wins.** Lower numeric values represent higher priority.
* If multiple rules match the incoming request, the CDN applies the rule with the highest priority.
* If no rules match, the CDN uses the default origin configuration.

Routing decisions consider:

* URI match pattern
* Origin protocol selection
* Domain/IP
* Ports
* Host header

This allows precise routing for APIs, media directories, file extensions, or multi-origin deployments.

## FAQ

**What happens if multiple rules match the same request?**

The rule with the **highest priority** (lowest priority number) is applied.

**Do regex or prefix rules impact performance?**

Regex rules are more expensive than prefix or extension matches. Use them only when necessary.

**What if no Advanced Origin rule matches the request?**

The request is sent to the **default origin** defined in the main Origin Settings section.

***

## Streaming Content Caching

For **Streaming Content Caching** resources, Advanced Origin Settings use a different structure based on **Origin Groups** and **URI Match Rules**.

Instead of defining individual origin rules directly, you first create origin groups containing one or more origins, then create URI match rules that route traffic to those groups.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-b3cc06b04c0fc72bfcb32ea04b0d814a97265716%2Fstreaming-origin-settings-overview.png?alt=media" alt=""><figcaption><p>Advanced Origin Settings for Streaming Content Caching – Origin Groups and URI Match Rules sections</p></figcaption></figure>

The page has two sections:

* **Origin Groups** – Define groups of origins for load balancing and failover.
* **URI Match Rules** – Assign URI patterns to origin groups to route traffic.

{% hint style="info" %}
You must create at least one origin group before you can add URI match rules.
{% endhint %}

### Create an Origin Group

You can create up to **50 origin groups**, and each group can contain up to **25 origins**.

{% stepper %}
{% step %}
**Open the Add Origin Group Dialog**

Click **Add group** in the **Origin Groups** section.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-8309f1c4c6c2ddb6f82bb2a470ff52bf83c61ad3%2Fstreaming-origin-add-group-dialog.png?alt=media" alt="" width="563"><figcaption><p>Add Origin Group Settings dialog</p></figcaption></figure>
{% endstep %}

{% step %}
**Configure the Origin Group**

Fill in the following fields:

* **Group Name** – Enter a descriptive name for the group.
* **Protocol** – Choose **HTTP**, **HTTPS**, or **Same as Request**.
* **Domain or IP** – Specify the origin server address.
* **HTTP Port / HTTPS Port** – Enter the port numbers for origin communication.
* **Host Header** – *(Optional)* Define a custom Host header if the origin requires it.
* **Weight** – Set a weight value for traffic distribution within the group.
* **Priority** – Choose **Primary** or **Backup** to define failover behavior.

Click **Add** to add the origin to the group.
{% endstep %}

{% step %}
**Submit Origin Groups**

After adding all origins, click **Submit groups** to save the configuration.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-5321d0875aabc7c74f84671e58ae4b8ff1e23523%2Fstreaming-origin-group-list.png?alt=media" alt=""><figcaption><p>Origin group with added origins – click Submit groups to save</p></figcaption></figure>

You can add more origins to the same group or create additional groups by clicking **Add group** again.
{% endstep %}
{% endstepper %}

### Add a URI Match Rule

After creating origin groups, define URI match rules to route traffic to the appropriate group.

{% stepper %}
{% step %}
**Open the Add Rule Dialog**

Click **Add rule** in the **URI Match Rules** section.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-0f87a7149435375226098d0aa4966c07cb03cc34%2Fstreaming-uri-rule-dialog.png?alt=media" alt="" width="563"><figcaption><p>Add Rule dialog – select match mode, enter rule, and assign an origin group</p></figcaption></figure>
{% endstep %}

{% step %}
**Configure the Rule**

Fill in the following fields:

* **URI Match Mode** – Choose **File Extension**, **Exact Path**, **Prefix**, or **Regex**.
* **URI Match Rule** – Enter the pattern to match (for example, `.m3h8` for HLS manifest files).
* **Origin Group** – Select the origin group that should handle matched requests.

Click **Add** to create the rule.
{% endstep %}

{% step %}
**Submit URI Match Rules**

You can reorder rules by dragging the handle icon (**≡**) on the left side of each rule — the rule at the top has the highest priority.

Click **Submit rules** to apply the URI match rules to the CDN resource.

<figure><img src="https://542970813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtK7oIwmhUHdEJcaH4Hx8%2Fuploads%2Fgit-blob-dbbc42fb585a31ca3becd247060f86cf6111a457%2Fstreaming-uri-rule-list.png?alt=media" alt=""><figcaption><p>URI match rules list – drag the ≡ handle to reorder priority, then click Submit rules to apply</p></figcaption></figure>
{% endstep %}
{% endstepper %}
