1 Overview
Let's first look at the configuration diagram of Nginx:
main # 全局配置
├── events # 配置网络连接
├── http # 配置代理、缓存、日志等
│ ├── upstream # 配置负载均衡
│ ├── server # 配置虚拟主机,可以有多个 server
│ ├── server
│ │ ├── location # 用于匹配 URI(URL 是 URI 的一种),可以有多个 location
│ │ ├── location
│ │ └── ...
│ └── ...
└── ...
Let's pull out the default configuration of Nginx and take a look. I added a comment, so that everyone can easily understand what this line of configuration is used for.
worker_processes