The NGINX configuration file follows a very logical format. Learning this format and how to use each section is one of the building blocks that will help you create a configuration file by hand. Constructing a configuration involves specifying global parameters as well as directives for each individual section. These directives and how they fit into the overall configuration file is the main subject of this chapter. The goal is to understand how to create the right configuration file to meet your needs.
This chapter will help you reach this goal by explaining the following topics:
The basic configuration format
NGINX global configuration parameters
Using the
include
filesThe HTTP server section
The virtual server section
Locations—where, when, and how?
The mail server section
Full sample configuration