nginx 模块组成
编写模块,需要实现下面5个部分
定义 ngx_module_t 模块结构体 定义commands 定义cxn 实现commands里对应的实现函数 实现handler函数 (command实现函数依赖handler函数) (这个才是真正干活的)
说明各个函数部分的意义
commandseg:
ngx_module_t ngx_http_circle_gif_module = { NGX_MODULE_V1, &ngx_http_circle_gif_module_ctx, /* module context */ ngx_http_circle_gif_commands, /* module directives */ NGX_HTTP_MODULE, /* module type */ NULL, /* init master */ NULL, /* init module */ NULL, /* init process */ NULL, /* init thread */ NULL, /* exit thread */ NULL, /* exit process */ NULL, /* exit master */ NGX_MODULE_V1_PADDING };