Getting Started with nginx: Configuration Document Structure

nginx official document address: http://nginx.org/en/docs/beginners_guide.html#conf_structure

Nginx consists of multiple modules, which are managed by directives in the configuration document. Directives can be divided into basic directives (simple directives) and block directives (block directives). The basic command consists of command name (name), parameters (parameters), separated by spaces, and each command ends with a semicolon. Block instructions have the same structure as basic instructions, except that block instructions end with a set of instructions enclosed in curly braces. If a block directive can contain other directives in curly brackets, it is called a context (eg events, http, server and location).

Directives placed in the configuration file, outside of all other contexts, are considered only in the main context. events and http directives belong to the main environment. The server belongs to http, and the location belongs to the server.

Note: The configuration file is marked with # as a comment

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324483675&siteId=291194637