X-Forwarded-Host

The HTTP X-Forwarded-Host (XFH) request header is a de-facto standard header for identifying the original host requested by the client in the Host HTTP request header.

Host names and ports of reverse proxies (load balancers, CDNs) may differ from the origin server handling the request, in that case the X-Forwarded-Host header is useful to determine which Host was originally used.

A standardized version of this header is the HTTP Forwarded header, although it's much less frequently used.

Header type Request header
Forbidden header name No

Syntax

http
X-Forwarded-Host: <host>

Directives

<host>

The domain name of the forwarded server.

Examples

http
X-Forwarded-Host: id42.example-cdn.com

Specifications

Not part of any current specification.

See also