# Custom Header

The Custom Header feature allows you to add, modify, or remove HTTP headers for both origin requests and CDN responses. This configuration enables fine-grained control over how headers are passed, overwritten, or stripped at different stages of the delivery flow.

When Custom Header is enabled, you can define multiple header actions, each with a specific key–value pair and rule type. All rules are executed by CDN edge servers for the selected CDN Resource.

You can configure Custom Header in the [Medianova Control Panel](https://cloud.medianova.com) or via [API](https://clients.medianova.com/api-documentation/performance-cdn/headers#put-api-v1-cdn-organization_uuid-resource-resource_uuid-1)

## Configure Custom Header

{% stepper %}
{% step %}
**Access Custom Header**

Go to **CDN → CDN Resources** and select a CDN Resource.\
Scroll to the **Custom Header** section.
{% endstep %}

{% step %}
**Enable Custom Header**

<figure><img src="/files/1InO4ysXwaNikFmm2tuF" alt="" width="563"><figcaption><p>Custom Header configuration interface in the Headers tab</p></figcaption></figure>

Toggle **Status** to enable the Custom Header feature.\
Verify that the rule configuration area becomes active.
{% endstep %}

{% step %}
**Create Custom Header Rules**

Select a header action from the dropdown.

**Available Header Actions**\
You can create header rules using the Add dropdown.\
Each option applies to a different stage of the request/response flow.\
**Add Origin Request Header**\
Adds a custom header to the request sent from CDN edge to the origin server.\
**Add CDN Response Header**\
Adds a custom header to responses delivered from CDN edge to the viewer.\
**Remove CDN Response Header**\
Removes a header from the response before it is sent to the viewer.\
**Raw Header**\
Creates a raw header rule with a custom directive, without binding it to request or response type logic. (Use only if you require fully custom header behavior.)\
**Remove Origin Request Header**\
Removes a header before the request is forwarded to the origin server.

Enter the **Key** and **Value** for the header, if the selected action requires one.<br>
{% endstep %}

{% step %}
**Select Submit to save**
{% endstep %}
{% endstepper %}

## Best Practices

* Header keys and values must follow valid HTTP header formatting rules.
* If the same header is modified by multiple rules, CDN edge behavior follows the order of applied rules.
* Removing headers may affect origin authentication, CORS behavior, or cache control logic.
* Use **Raw Header** only when standard rule types do not fit your use case.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://clients.medianova.com/products/performance-cdn/static-content-delivery/advanced-configuration/headers/custom-header.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
