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 Override Host header field. enter your header — the domain name without specifying a 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 resolved, 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 name without protocol, e.g.example.com
;<ip_address>
— Source IP address with protocol, e.g.https//:192.168.1.1
.