Host
The authority that the request is intended for.
Fastly reads this header from requests. It is defined by an external standard.
Fastly hosts multiple customer services on the same set of IP addresses, and in most cases uses the Host
header to identify the service that should handle a request (the main exception to this is customers that have purchased dedicated IP address space and pinned the dedicated IPs to a specific service).
The value of the HTTP Host
header is lowercased before being assigned to req.http.host
to ensure consistent behavior of Fastly customer services and origins. This happens prior to vcl_recv
and means that no matter how your site’s domain name is capitalized in the request, any VCL that uses the host value will result in the same cache address and therefore find the same cache object. This does not apply to req.url
, which is not subject to normalization and will reflect the capitalization present on the request as it was received.
Multiple domains can be associated with a Fastly service. A common use case for the Host
header inside a service configuration is to canonicalize the host:
if (req.http.host != "example.com") { error 600; # Trigger an error in order to redirect to example.com}
In many cases, backend servers are also operated in a similar manner, and require a specific Host
to be provided in order to serve the correct content or invoke the correct process (as is the case for providers such as Heroku, AWS S3 or Google Cloud Storage).