1 Answer

0 votes
by

Nginx consists of modules that are controlled by directives defined in the configuration file. Directives are divided into two parts:

  • Simple Directive: A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;).
  • Block Directive: The structure of block directive is similar to the simple directive, but instead of semicolon, it ends with a set of additional instructions surrounded by curly braces ({ and }). If a block directive can have other directives inside the braces, then it is known as context. Eg. Events, http, location, and server.

Directives placed in the configuration file outside of any contexts are considered to be in the main context. The events and http directives reside in the main context, server resides in http and location in the server.

...