---
title: "Manage the Host header when requesting content from an origin"
sidebar_label: "Manage Host header"
description: "How to manage the Host header when requesting content from an origin"
sidebar_position: 4
---

import Formbricks from '@theme/MDXComponents/Formbricks'

# Manage Host header when requesting content from the origin

CDN requests content from the origin—a server where your website or files are hosted.

When requesting content from the origin, CDN passes the domain in the `Host` HTTP header so the server can serve content from the required domain. By default, the domain of the website from which the request originated is passed.

If your origin content is on a platform where one server handles multiple domains (e.g., [S3](/s3/)), you must [specify an origin `Hostname` —](#set-content-source-hostname) the origin address used by the CDN to fetch content. If you do not specify a `Hostname`, the server will not be able to determine which domain the user is requesting and will return an error.

If your server handles multiple domains, you can [pass the Host header from the user](#pass-user-host-header).

## Specify the origin Hostname \{#set-content-source-hostname}

You cannot simultaneously specify a Hostname and [pass the Host header from the user](#pass-user-host-header).

1. In the [control panel](https://my.selectel.ru/cdn-v3), from the top menu, click **Products** and select **CDN**.

2. In the **CDN Resources** section, open the CDN resource page → **Origin** tab.

3. In the **Hostname** block, specify the content source address — a domain name without a protocol. You can add a port, for example `example.com:443`.

4. Click **Apply**. While settings are being applied, the CDN resource enters the `PROCESSING` status. You cannot apply other settings during this time. Settings take effect when the CDN resource transitions to `ACTIVE`.

5. Ensure that the header value is allowed by your web server, where the domain content is hosted. If the header is not allowed, the request will return a `400 Bad Request` or `403 Forbidden Response` error.

   Example request to check:

   ```bash
   $ curl -H "Host: <domain>" -I <ip_address>
   ```

   Specify:

   * `<domain>` — domain name without the protocol, for example, `example.com`;
   * `<ip_address>` — origin IP address including the protocol, for example, `https://192.168.1.1`.

## Pass the Host header from the user \{#pass-user-host-header}

You cannot simultaneously pass the Host header from the user and specify the [origin Hostname](#set-content-source-hostname).

1. In the [control panel](https://my.selectel.ru/cdn-v3), from the top menu, click **Products** and select **CDN**.

2. In the **CDN Resources** section, open the CDN resource page → **Origin** tab.

3. In the **Hostname** block, check the **Pass original Host header** box.

4. Click **Apply**. While settings are being applied, the CDN resource enters the `PROCESSING` status. You cannot apply other settings during this time. Settings take effect when the CDN resource transitions to `ACTIVE`.

5. Ensure that the header value is allowed by your web server, where the domain content is hosted. If the header is not allowed, the request will return a `400 Bad Request` or `403 Forbidden Response` error.

   Example request to check:

   ```bash
   $ curl -H "Host: <domain>" -I <ip_address>
   ```

   Specify:

   * `<domain>` — domain name without the protocol, for example, `example.com`;
   * `<ip_address>` — origin IP address including the protocol, for example, `https://192.168.1.1`.

<Formbricks />
