X-Host
The HTTP X-Host unofficial header carries a hostname: as a request header, proxies use the name to preserve the client's original Host value, while observed live traffic shows servers echoing it on responses, often with an internal node name.
Usage
When a reverse proxy forwards a request to a backend server,
the Host header in the forwarded request typically reflects
the backend's hostname rather than the hostname the client
originally requested. The X-Host header carries the
original value so backend applications retain access to the
original hostname.
A client requests www.example.re. The reverse proxy
forwards the request to an internal backend at
backend-01.internal. The Host header in the forwarded
request now reads backend-01.internal. X-Host is added
to carry www.example.re so the backend knows which
hostname the client addressed.
X-Host serves the same purpose as
X-Forwarded-Host and the standardized
Forwarded header's host parameter. The three
headers differ in origin and format. Forwarded is the IETF
standard. X-Forwarded-Host is the older de facto convention
with wide adoption. X-Host is a shorter variant used by
some proxy configurations. All three convey the original
Host value.
Backend applications use the original hostname for URL generation, redirect construction, canonical link resolution, and virtual host routing.
Observed traffic runs the other direction. Every
crawled occurrence is a response header, where
platforms echo either the served hostname
(mobileproxy.ee, cointelegraph.com) or an
internal node name, such as Weebly backends
answering as blu100.sf2p.intern.weebly.net. A
response-side X-Host leaks infrastructure naming
rather than preserving anything for the client.
Values
In the request-header convention, the value is the
original hostname as received in the client's
Host header. Observed response values carry the
served domain or an internal backend node name, with
or without a port number.
Common formats:
www.example.re: standard domain without portexample.re:8080: domain with explicit port
Example
A reverse proxy forwards a request from a client originally
addressing www.example.re. The backend receives
the original hostname via X-Host.
X-Host: www.example.re
When the client request includes a non-standard port, the port is preserved in the X-Host value.
X-Host: api.example.re:8080
Some proxy configurations send both X-Host and
X-Forwarded-Host for compatibility with backends expecting
either header.
X-Host: www.example.re
X-Forwarded-Host: www.example.re