Manage Host Headers
When a CDN server requests content from a source, it refers to an IP address, not a domain name. Multiple domains can point to the same IP address. To ensure that the CDN server requests content from the correct domain, the server's request to the source uses a Host
header specifying the domain.
By default, when creating a CDN resource, the Host
header is set to Auto
: requests specify the domain from which the request came.
To explicitly set the desired domain using the Host
header,set your Host
header.
Set a custom Host header
-
In the Control Panel, on the top menu, click Products and select CDN.
-
Open the CDN resource page → General tab.
-
In the Content Source block, click Edit Source.
-
In the Host header override field, enter your own header — the domain name without specifying the protocol. If necessary, you can add a port, for
example, example.com:443
. -
Click Save.
-
Check that the header value is resolved on the side of your web server where the domain content resides. If the header is not allowed, the request will return a
400 Bad Request
or403 Forbidden Response
error.Example of a request for validation:
$ curl -H "Host: <domain>" -I <ip_address>
Specify:
<domain>
— domain without a protocol;<ip_address>
— IP address of the source with protocol.