Via

The HTTP Via header records the intermediate protocols and recipients between the user agent and the server, tracking how a message has been routed through proxies and gateways.

Usage

Proxies and gateways append an entry to the Via header on both requests and responses. Each entry identifies the protocol version used by the intermediary and a pseudonym or hostname for the node. The header serves two purposes: loop detection and protocol capability tracking.

When a proxy receives a message containing its own identifier in the Via chain, the proxy detects a forwarding loop and rejects the request. The protocol version recorded in each entry also tells downstream nodes what HTTP features the intermediary supports.

The Via header tracks the message path at the protocol level. The Forwarded header serves a different purpose by carrying the original client address, host, and protocol information.

Values

Each Via entry follows the format:

received-protocol received-by

The received-protocol consists of an optional protocol name and a required version number. When the protocol is HTTP, the name is often omitted, leaving only the version (e.g., 1.1 instead of HTTP/1.1).

The received-by field contains either the host and optional port of the intermediary, or a pseudonym representing the node. Proxies hiding internal topology use a pseudonym such as edge_1 instead of a real hostname.

An optional comment enclosed in parentheses follows the received-by field, often identifying the proxy software.

Example

A response passing through two proxies shows both entries in the Via header. The first proxy identifies itself by hostname and uses the full protocol name. The second uses a pseudonym.

Via: HTTP/1.1 proxy.example.re, 1.1 edge_1

A single HTTP/2 proxy forwarding a request over HTTP/1.1 to the origin records the protocol downgrade.

Via: 2.0 gateway.example.re

A proxy including a software comment adds the product name in parentheses after the hostname.

Via: 1.1 cache.example.re (Varnish/7)

Takeaway

The HTTP Via header maintains a record of every proxy and gateway a message passes through, enabling loop detection and protocol version tracking across the forwarding chain.

See also

Last updated: March 4, 2026