accept_mutex
| Syntax: | accept_mutex on | off;
| | —- | —- | | Default: | accept_mutex off; | | Context: | events |
on 避免惊群 , 防止多个进程对连接的争抢
daemon
| Syntax: | daemon on | off;
| | —- | —- | | Default: | daemon on; | | Context: | main |
error_log
| Syntax: | error_log file [level];
| | —- | —- | | Default: | error_log logs/error.log error; | | Context: | main, http, mail, stream, server, location
|
debug, info, notice, warn, error, crit, alert, emerg
events
| Syntax: | events { … }
| | —- | —- | | Default: | — | | Context: | main |
include
| Syntax: | include file | mask;
| | —- | —- | | Default: | — | | Context: | any |
use
| Syntax: | use method;
| | —- | —- | | Default: | — | | Context: | events |
默认由 os 决定
事件驱动模型 select poll epoll kqueue
user
| Syntax: | user user [group];
| | —- | —- | | Default: | user nobody nobody; | | Context: | main |
pid
| Syntax: | pid file;
| | —- | —- | | Default: | pid logs/nginx.pid; | | Context: | main |
master_process
| Syntax: | master_process on | off;
| | —- | —- | | Default: | master_process on; | | Context: | main |
worker_processes
| Syntax: | worker_processes number | auto;
| | —- | —- | | Default: | worker_processes 1; | | Context: | main |
worker_connections
| Syntax: | worker_connections number;
| | —- | —- | | Default: | worker_connections 512; | | Context: | events |
multi_accept
| Syntax: | multi_accept on | off;
| | —- | —- | | Default: | multi_accept off; | | Context: | events |
off worker进程同时只处理一个新的连接
