Manage Host Headers
When a CDN server requests content from a source, it refers to the IP address, not the domain name. Multiple domains can point to the same IP address. In order for the CDN server to request content from the correct domain, a Host
header specifying the domain is used in the server's request to the source.
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 custom Host header
-
In Control Panel, go to CDN → CDN Resources.
-
Open the CDN resource page.
-
Open the General tab.
-
In the Content Source block, click Edit Source.
-
In the Host Header Override field, enter your header — the domain name without specifying the protocol. If necessary, you can add a port, such as
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 give a
400 Bad Request
or403 Forbidden Response
error.Example of a request for validation:
$ curl -H "Host: <domain>" -I <ip_address>
Specify:
<domain>
is a domain without a protocol;<ip_address>
— IP address of the source with protocol specification.