X-Domain
The HTTP X-Domain response header is an unofficial header reflecting the domain name associated with the response.
Usage
The X-Domain header is set by reverse proxies, CDNs, and multi-tenant platforms to indicate which domain configuration produced the response. In environments where a single backend serves many domains, the header makes the matched domain explicit in the response, aiding debugging and log analysis.
A common scenario is a reverse proxy handling traffic for dozens of virtual hosts. When a request arrives, the proxy matches the request to a domain configuration, routes traffic to the appropriate backend, and echoes the matched domain in X-Domain. This confirms routing is working as expected, especially when multiple domain names map to the same IP or backend pool.
The header is closely related to X-Forwarded-Host,
which carries the original Host value through a proxy chain. Where
X-Forwarded-Host preserves the client's requested domain,
X-Domain reflects the domain the server resolved the request to,
which differs in alias or wildcard configurations.
Note
The "X-" naming convention for HTTP headers, "X" referring to "experimental", has been deprecated and needs to be transitioned to the formal naming convention for HTTP headers.
Values
The value is a domain name string matching the domain the server used to select the configuration generating the response.
Example
A response where the proxy has matched and echoed the primary domain serving the request.
X-Domain: example.re
A multi-tenant platform serving a customer's custom domain, echoing the matched domain back in the response.
X-Domain: shop.brand.example.re
Takeaway
The X-Domain header reflects the domain name the server associated with the response. Reverse proxies and multi-tenant platforms expose domain routing decisions for debugging in environments where many domains share backend infrastructure.