Chapter 2[ 33 ]This logic is expressed in the following flowchart:
Host header matches
server_name with a
wildcard at the front?Is there a
default_server?Find sever context
with listen/port matchDoes the Host header
match the server_name
as a string?Host header matches
server_name with a
wildcard at the end?Host header matches
server_name with a
regular expression?Does the IP/port
match the listen?Request from clientFind server context
with listen/port matchFind server context
with listen/port matchDirect to
default_serverContinue with request
processing.Ye sYe sYe sYe sYe sYe sYe sNoNoNoNoNoNoNodefault_server can be used to handle requests that would otherwise go unhandled.
It is therefore recommended to always set default_server explicitly, so that these
unhandled requests will be handled in a defined manner.