The server compares the Host header with a small virtual-host table.

highlighted = computed this step

The server compares Host to rows

Each virtual-host row has a host name and a site name.

route rows=3\text{route rows}=3
Virtual-host rowsThe virtual-host rows are recomputed from the parsed Host header.Virtual-host rows - Host net.example selects net-docssectionnamevaluecheckrequest linemethodGETparsedrequest linepath/booksparsedrequest lineversionHTTP/1.1parsedheaderHostnet.exampleexactheaderAccepttext/htmlexactvirtual hostHostnet.examplecompare rowsroutenet.examplenet-docsyes / yes / selectrouteshop.exampleshopno / no / skiproutedefaultfallbackyes / no / not reached

The first row is net.example

The first row has host net.example and site net-docs.

net.examplenet-docs\text{net.example}\to\text{net-docs}
Virtual-host rowsThe virtual-host rows are recomputed from the parsed Host header.Virtual-host rows - Host net.example selects net-docssectionnamevaluecheckrequest linemethodGETparsedrequest linepath/booksparsedrequest lineversionHTTP/1.1parsedheaderHostnet.exampleexactheaderAccepttext/htmlexactvirtual hostHostnet.examplecompare rowsroutenet.examplenet-docsyes / yes / selectrouteshop.exampleshopno / no / skiproutedefaultfallbackyes / no / not reached

Other rows are still checked

The shop row does not match, and the default row is only fallback.

fallback is not first choice\text{fallback is not first choice}
Virtual-host rowsThe virtual-host rows are recomputed from the parsed Host header.Virtual-host rows - Host net.example selects net-docssectionnamevaluecheckrequest linemethodGETparsedrequest linepath/booksparsedrequest lineversionHTTP/1.1parsedheaderHostnet.exampleexactheaderAccepttext/htmlexactvirtual hostHostnet.examplecompare rowsroutenet.examplenet-docsyes / yes / selectrouteshop.exampleshopno / no / skiproutedefaultfallbackyes / no / not reached

Summary

A virtual-host table is a small lookup: compare the Host header to configured rows.

Host compared to rows\text{Host compared to rows}
Virtual-host rowsThe virtual-host rows are recomputed from the parsed Host header.Virtual-host rows - Host net.example selects net-docssectionnamevaluecheckrequest linemethodGETparsedrequest linepath/booksparsedrequest lineversionHTTP/1.1parsedheaderHostnet.exampleexactheaderAccepttext/htmlexactvirtual hostHostnet.examplecompare rowsroutenet.examplenet-docsyes / yes / selectrouteshop.exampleshopno / no / skiproutedefaultfallbackyes / no / not reached