nginx模块开发入门(八)-3.3 Handler Installation
3.3. Handler Installation
3.3. Handler的装载
Handler的装载通过往模块启用了的指令的回调函数中添加代码来完成。比如,例子circle gif 中ngx_command_t是这样的:
static char *ngx_http_circle_gif(ngx_conf_t *cf, ngx_command_t *cmd, void *conf){ ngx_http_core_loc_conf_t *clcf; clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module); clcf->handler = ngx_http_circle_gif_handler; return NGX_CONF_OK;}