nginx配置
… … #核心摸块 events { #事件模块 … } http { # http 模块 server { # server块 location [PATTERN] { # location块 … } location [PATTERN] { … } } server { … } } mail { # mail 模块 server { # server块 … } } 我们依次看一下每个模块一般有哪些配置项。 核心模块 user admin; #配置用户或者组 worker_processes 4; #允许生成的进程数,默认为1 pid /nginx/pid/nginx.pid; #指定 nginx 进程运行文件存放地址 error_log log/error.log debug; #错误日志路径,级别 事件模块 events { accept_mutex on; #设置网路连接序列化,防止惊群现象发生,默认为on multi_accept on; #设置一个进程是否同时接受多个网络连接,默认为off use epoll; #事件驱动模型select|poll|kqueue|epoll|resig worker_connections 1024; #最大连接数,默认为512 } http 模块 http { include mime.types; #文件扩展名与文件类型映射表