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), you must specify an origin 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.
Specify the origin Hostname
You cannot simultaneously specify a Hostname and pass the Host header from the user.
-
In the control panel, from the top menu, click Products and select CDN.
-
In the CDN Resources section, open the CDN resource page → Origin tab.
-
In the Hostname block, specify the origin address—the domain name without the protocol. You can add a port, for example,
example.com:443. -
Click Apply. While settings are being applied, the CDN resource enters the
PROCESSINGstatus. You cannot apply other settings during this time. Settings take effect when the CDN resource transitions toACTIVE. -
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 Requestor403 Forbidden Response.Example request to check:
$ 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
You cannot simultaneously pass the Host header from the user and specify the origin Hostname.
-
In the control panel, from the top menu, click Products and select CDN.
-
In the CDN Resources section, open the CDN resource page → Origin tab.
-
In the Hostname block, check the Pass original Host header box.
-
Click Apply. While settings are being applied, the CDN resource enters the
PROCESSINGstatus. You cannot apply other settings during this time. Settings take effect when the CDN resource transitions toACTIVE. -
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 Requestor403 Forbidden Response.Example request to check:
$ 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.