The Host header is a mandatory HTTP request header that specifies the domain name (and optionally the port) of the target server. It plays a fundamental role in HTTP/1.1, as it tells the server which site or application the user intends to access—especially when multiple services are hosted on the same IP address. While the Referer header tells the server where the request is coming from, the Host header defines where the request is going to. In VergeCloud, the Host header is not just passively received—it is an actively configurable part of your CDN, DNS, and Load Balancer settings. Whether you are using CNAME, ANAME records, or routing through Page Rules or Load Balancer, VergeCloud allows you to rewrite or modify the Host header before it reaches your origin. This ensures flexibility, compatibility with services like S3, and precise control over backend routing and security policies. Understanding how VergeCloud handles and lets you manage the Host header is critical, as it appears in several areas of your dashboard, including domain configuration, Page Rules, and Load Balancer settings.
By default, VergeCloud uses the Host header sent by the user to determine which domain or subdomain the request targets. However, you can customize the Host header in various ways depending on your needs:
This flexible approach allows you to:
Amazon S3 uses virtual-hosted-style URLs that require the Host header to match the bucket name (e.g., mybucket.s3.amazonaws.com). VergeCloud allows you to rewrite the Host header at the DNS, Page Rule, or Load Balancer level, ensuring compatibility with S3 and preventing 404 errors due to header mismatch.
SaaS platforms often allow custom domains for their clients (e.g., client1.yourapp.com). VergeCloud uses the Host header to route requests to the correct tenant space. By rewriting the Host header when needed, you can also ensure that internal backends receive the expected tenant identifier domain.
For complex API infrastructures, VergeCloud lets you rewrite the Host header per API route using Page Rules or Load Balancer settings. This helps when your backend services expect different Host headers for microservices, ensuring seamless multi-service backend integration under a unified CDN layer.
Enforcing and rewriting the Host header in VergeCloud ensures that invalid or forged Host headers cannot reach your origin, preventing Host header injection attacks or domain spoofing attempts. This helps maintain security and integrity of your backend services.
You can manage and rewrite the Host header in VergeCloud using different areas of your dashboard:
VergeCloud ensures that your configurations at all these levels work seamlessly together, giving you full control over how the Host header is handled across different scenarios, from static content delivery to complex SaaS and API environments.