Host Header Explained
What the HTTP Host header does and when it's used.
Published October 15, 2026
Host specifies the domain name (and optional port) of the server the client wants, enabling many sites on one IP address (virtual hosting).
How it works
It is mandatory in HTTP/1.1. In HTTP/2 the equivalent is the :authority pseudo-header.
The Host header is part of the HTTP message and is case-insensitive in name.
In a real exchange
curl -i https://example.com/
Host: example.com
Practical examples
The header
Host: example.comSet or use it in code
server { server_name example.com; }Inspect it
curl -sI https://example.com | grep -i 'host'Common mistakes
- Trusting Host for generating password-reset links (host header injection)
- Missing it behind proxies
- Not forwarding it in reverse proxies
Key takeaways
- Host: Host specifies the domain name (and optional port) of the server the client wants, enabling many sites on one IP address (virtual hosting).
- Check it in browser DevTools → Network.
- Test with curl -I before deploying.
FAQ
Why is it required?
So one IP can serve many domains.
Is Host case sensitive?
Header names are case-insensitive; values may not be.