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. In order for the CDN server to request content from the correct domain, a header is used in the server's request to the source. Host
indicating the domain.
By default, when a CDN resource is created, the header is Host
set to Auto
: requests specify the domain from which the request came.
To use the header Host
explicitly set the desired domain, set your header Host
.
Set a custom Host header
-
В control panels go to CDN → CDN resources.
-
Open the CDN resource page.
-
Open the tab General.
-
In the block Content Source click Edit source..
-
In the field Host header override enter your header — the domain name without specifying the protocol. If necessary, you can add a port, e.g,
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 an error
400 Bad Request
or403 Forbidden Response
.Example of a request for validation:
$ curl -H "Host: <domain>" -I <ip_address>
Specify:
<domain>
— a domain without a protocol;<ip_address>
— The source IP address with the protocol.