The HTTP core module
The http module is NGINX's central module; it handles all interactions with clients over HTTP. We already discussed the following aspects of this module in Chapter 2, A Configuration Guide:
Client directives
File I/O directives
Hash directives
Socket directives
The
listendirectiveMatching a request to a
server_nameandlocationdirective
We will have a look at the remaining directives in the rest of this section, again divided by type.
The server directive
The server directive starts a new context. We have already seen examples of its usage throughout the book so far. One aspect that has not yet been examined in-depth is the concept of a
default server.
A default server in NGINX means that it is the first server defined in a particular configuration with the same listen IP address and port as another server. A default server may also be denoted by the default_server parameter to the listen directive.
The default server is useful to define a set of common directives that will...