Host header
The request header that names the server and port the request is for, such as Host: localhost:8765.
In more detail
It is required in HTTP/1.1 because one address can serve many sites, and the server needs to know which one you meant. Proxies and gateways use it to route requests to the right site or service.
Example
A reverse proxy or web server uses it to pick the right site or origin. A wrong Host header is a common reason a request reaches the right machine but gets the wrong site.Related terms
- HTTP request — The message a client sends to a server: a method, a target, a protocol version, headers, a blank line and an optional body.
- HTTP header — A named line of metadata in an HTTP message, such as Content-Type: application/json, that describes the body, the caller or how to handle the exchange.
- reverse proxy — A server that receives requests on behalf of other servers and forwards them, returning their responses as if they were its own.
Taught in
- What An API Is, And The Alternatives — Modern API Architecture: REST, GraphQL & gRPC
- HTTP Is Text: Requests, Status Codes And Headers — Linux Fundamentals & Systems Administration
- Variables, The PATH And The History — LPIC-1 Linux Administrator (101-500 and 102-500) Exam Prep