Nginx configuration file in our conf/nginx.conf, we vi nginx.conf enter the file, can see, the file consists of three parts

Global block

From the start of the configuration file to the events block, which sets up commands that affect nginx as a whole, worker_processes 1; Indicates the number of concurrent nginx processes. The larger the value, the more the number of concurrent nginx processes, but is affected by hardware

Second, the events

The Events block involves instructions that affect the network connection between the NGINx server and the user. worker_connections 1024; This configuration means that the maximum number of connections supported is 1024

 

HTTP block (core)

HTTP global blocks contain HTTP global fast and Server blocks

HTTP global block configuration commands include file import, MIME-Type definition, log customization, connection timeout, maximum number of single connection requests, and so on

Server blocks, each HTTP block can contain multiple Server blocks, and each Server block contains both the global Server block and the Location block