A Configuration Guide
[ 40 ]
Summary
In this chapter, we have seen how the NGINX configuration file is built. Its
modular nature is a reflection, in part, of the modularity of NGINX itself. A global
configuration block is responsible for all aspects that affect the running of NGINX
as a whole. There is a separate configuration section for each protocol that NGINX
is responsible for handling. We may further define how each request is to be
handled by specifying servers within those protocol configuration contexts (either
http or mail), so that requests are routed to a specific IP address/port. Within
the http context, locations are then used to match the URI of the request. These
locations may be nested or otherwise ordered to ensure that requests get routed
to the right areas of the filesystem or application server.
What we did not cover in this chapter are the configuration options provided by
the various modules that may be compiled into your nginx binary. These additional
directives will be touched upon throughout the book, as that particular module is
used to solve a problem. Also absent was an explanation of the variables that NGINX
makes available for its configuration. These too will be discussed later in this book.
This chapter's focus was on the basics of configuring NGINX.
In the next chapter, we will explore configuring NGINX's mail module, to enable
mail proxying.