前言
Nginx框架是围绕着ngx_cycle_t结构体运行的。ngx_cycle_t结构体中包含的信息主要可以分为以下部分:
- 所有模块的配置信息
- Nginx运行时所需要的一些资源,包括连接池,内存池,打开文件,操作目录等等
本文将详细介绍ngx_cycle_t结构体所包含的内容。
ngx_cycle_t结构体的内容
struct ngx_cycle_s {
//保存所有模块的配置结构体
void ****conf_ctx;
//内存池
ngx_pool_t *pool;
//日志信息
ngx_log_t *log;
ngx_log_t new_log;
ngx_uint_t log_use_stderr; /* unsigned log_use_stderr:1; */
ngx_connection_t **files;
//连接池
ngx_conne