HTTPREF
← Back to headers

HTTP Header

X-Forwarded-Host

Networking

Indicates the original Host requested by the client before proxy forwarding.

HTTP header reference, syntax, examples, and developer usage.

What is the X-Forwarded-Host header?

The X-Forwarded-Host HTTP header is used to transmit metadata between a client and server as part of HTTP requests or responses.

HTTP headers define how content should be interpreted, cached, authenticated, secured, or processed by browsers and APIs.

Direction

This header may appear in both HTTP requests and responses.

Syntax

X-Forwarded-Host: original-host

Example

X-Forwarded-Host: app.example.com

Common use cases

  • Reverse proxy awareness
  • Original host reconstruction
  • Routing logic behind gateways

Common mistakes

  • Using the header in the wrong request or response context
  • Sending invalid header values
  • Incorrect header syntax
  • Assuming the header automatically changes server behaviour

Related headers