ViaVia records, in order, the proxies and gateways a request or response passed through between the original sender and the final recipient. Each intermediary appends itself to the list.
Each entry is `protocol-version receiver-id [comment]` (e.g. `1.1 varnish`), and multiple hops are comma-joined into a path history.
The value consists of the protocol version each intermediary handled (e.g. `1.1`, `HTTP/1.1`) plus a name that identifies it (a host, pseudonym, or alias like `varnish` or `vegur`). On the request path, proxies in the client→server direction append themselves; on the response path, caches and gateways in the server→client direction do — which is why Via can appear on both.
It has two main uses. First, debugging and tracing — knowing which CDNs, caches, and gateways a request traversed helps diagnose latency and caching issues. Second, loop detection — a proxy that sees its own identifier already in Via can recognize an infinite forwarding loop and break it.
Via records which nodes were traversed (the intermediary path), whereas X-Forwarded-For and Forwarded convey who the original client is (the sender's address). Their roles don't overlap, so they're used together. Because each hop's name and version are exposed, operators who dislike leaking internal infrastructure often shorten or strip Via at the gateway.
Via: [<protocol-name>/]<protocol-version> <host>[:<port>] [<comment>]e.g. Via: 1.1 vegur, 1.1 varnish