NGX_HTTP_MAIN_CONF:可出现在 http 的主作用域; NGX_HTTP_SRV_CONF:可出现在 http 的 server 作用域; NGX_HTTP_LOC_CONF:可出现在 http 的 location 作用域; NGX_HTTP_UPS_CONF:可出现在 http 的 upstream 作用域; NGX_HTTP_SIF_CONF:which will allow the directive to be included in if statements ...
在URI 与 location 匹配前修改请求的 URI(重定向)*/NGX_HTTP_SERVER_REWRITE_PHASE,//该阶段handler方法有:ngx_http_rewrite_module(ngx_http_rewrite_init->ngx_http_rewrite_handler)/*根据URI寻找匹配的location,这个阶段通常由ngx_http_core_module模块实现,不建议其他HTTP模块重新定义这一阶段的行为 // 根据...
1、 在ngx_http_core_main_conf_t结构体中有一个字段为ports,是一个数组,数组内存放的全是ngx_http_conf_port_t;对于每个端口信息(ngx_http_conf_port_t),调用 ngx_http_server_names函数,同一时候也调用ngx_http_init_listening函数,这里先分析ngx_http_server_names函数。 2)对于每个端口信息(ngx_http_co...
NGX_HTTP_LOC_CONF_OFFSET, offsetof(ngx_http_auth_basic_loc_conf_t, user_file), NULL }, ngx_null_command }; static ngx_http_module_t ngx_http_auth_basic_module_ctx = { NULL, /* preconfiguration */ ngx_http_auth_basic_init, /* postconfiguration */ NULL, /* create main configuratio...
ngx_http_process_request_line(ngx_event_t *rev) { ssize_t n; ngx_int_t rc, rv; ngx_str_t host; ngx_connection_t *c; ngx_http_request_t *r; c = rev->data; // 当前事件对应的连接 r = c->data; // 当前连接对应的请求 ...
static ngx_http_module_t ngx_http_stub_status_module_ctx = { NULL, /* preconfiguration */ NULL, /* postconfiguration */ NULL, /* create main configuration */ NULL, /* init main configuration */ NULL, /* create server configuration */ ...
static ngx_int_t ngx_rtmp_core_preconfiguration(ngx_conf_t *cf); static void *ngx_rtmp_core_create_main_conf(ngx_conf_t *cf); static char *ngx_rtmp_core_init_main_conf(ngx_conf_t *cf, void *conf); static void *ngx_rtmp_core_create_srv_conf(ngx_conf_t *cf); ...
_http_auth_basic_init, /* postconfiguration */ NULL, /* create main configuration */ NULL, /* init main configuration */ NULL, /* create server configuration */ NULL, /* merge server configuration */ ngx_http_auth_basic_create_loc_conf, /* create location configuration */ ngx_http_...
void *conf); static ngx_int_t ngx_http_limit_req_add_variables(ngx_conf_t *cf); static ngx_int_t ngx_http_limit_req_init(ngx_conf_t *cf);static ngx_conf_enum_t ngx_http_limit_req_log_levels[] = { { ngx_string("info"), NGX_LOG_INFO }, ...
ngx_http_core_main_conf_t *cmcf; size_t size;r = sr->parent;sr->header_in = r->header_in;if (body) { sr->request_body = body;rc = ngx_http_lua_set_content_length_header(sr, body->buf ? ngx_buf_size(body->buf)