The web
Virtual host
Many sites on one address and port, told apart by the Host header in each request.
A virtual host is one of several sites served from the same address and port. DNS only brings the client to the
address; the Host header in the request names the site, and the server matches it against each site's names
(nginx's server_name). An unknown name goes to the default server. HTTP/1.1 requires the header: without
it the server answers 400. Over HTTPS the name travels in the TLS SNI.
Read next
- HTTP The web's request and response protocol: plain text over TCP unless wrapped in TLS.
- SNI The site name sent in the clear at the start of a TLS handshake, so the server can pick a certificate.
- DNS records The typed entries of a zone: A for an address, CNAME for an alias, NS for delegation, and more.