nginx_module_t
2016-08-22 15:16:31 5 举报
AI智能生成
登录查看完整内容
nginx_module_t
作者其他创作
大纲/内容
ngx_module_t
0. ngx_core_module
ngx_core_module_ctx
\"core\"
ngx_core_module_create_conf
ngx_core_conf_t
ngx_core_module_init_conf
对于unset值设置为默认值
ngx_core_commands
daemon
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_FLAG
ngx_conf_set_flag_slot
master_process
master
timer_resolution
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1
ngx_conf_set_msec_slot
pid
ngx_conf_set_str_slot
lock_file
worker_processes
ngx_set_worker_processes
debug_points
ngx_conf_set_enum_slot
user
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE12
ngx_set_user
pw_uid
group
gr_gid
worker_priority
ngx_set_priority
priority
worker_cpu_affinity
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_1MORE
ngx_set_cpu_affinity
cpu_affinity_n
cpu_affinity
worker_rlimit_nofile
ngx_conf_set_num_slot
rlimit_nofile
worker_rlimit_core
ngx_conf_set_off_slot
rlimit_core
working_directory
env
ngx_load_module
用于加载动态库
NGX_CORE_MODULE
1. ngx_errlog_module
ngx_errlog_module_ctx
errlog
ngx_errlog_commands
error_log
NGX_MAIN_CONF|NGX_CONF_1MORE
ngx_error_log
cycle->new_log
2. ngx_conf_module
ngx_conf_commands
include
NGX_ANY_CONF|NGX_CONF_TAKE1
ngx_conf_include
NGX_CONF_MODULE
3. ngx_events_module
ngx_events_module_ctx
events
ngx_event_init_conf
仅用于确认配置是否存在,若不存在则直接报错
ngx_events_commands
NGX_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS
ngx_events_block
创建NGX_EVENT_MODULE配置信息
ngx_conf_parse
设置配置文件信息到内存
对NGX_EVENT_MODULE未配置信息默认值初始化
4. ngx_event_core_module
ngx_event_core_module_ctx
event_core
ngx_event_core_create_conf
ngx_event_core_init_conf
ngx_event_core_commands
worker_connections
NGX_EVENT_CONF|NGX_CONF_TAKE1
ngx_event_connections
cycle->connection_n = ecf->connections
use
ngx_event_use
ecf->use = cf->cycle->modules[m]->ctx_index;
multi_accept
NGX_EVENT_CONF|NGX_CONF_FLAG
accept_mutex
accept_mutex_delay
debug_connection
ngx_event_debug_connection
NGX_EVENT_MODULE
ngx_event_module_init
ngx_event_process_init
初始化超时时间红黑树
epoll.actions.init()
设置定时器
c[i].data = next;
c[i].read = &cycle->read_events[i];
c[i].write = &cycle->write_events[i];
c[i].fd = (ngx_socket_t) -1;
next = &c[i];
rev[i].closed = 1;
rev[i].instance = 1;
wev[i].closed = 1;
将listen和connection关联,并添加可读事件
5. ngx_epoll_module
ngx_epoll_module_ctx
epoll
ngx_epoll_create_conf
ngx_epoll_init_conf
ngx_event_actions_t
add
ngx_epoll_add_event
del
ngx_epoll_del_event
enable
disable
add_conn
ngx_epoll_add_connection
del_conn
ngx_epoll_del_connection
notify
ngx_epoll_notify/NULL
process_events
ngx_epoll_process_events
init
ngx_epoll_init
done
ngx_epoll_done
ngx_epoll_commands
epoll_events
worker_aio_requests
aio_requests
6. ngx_http_module
ngx_http_module_ctx
http
ngx_http_commands
ngx_http_block
配置所有NGX_HTTP_MODULE配置
create_main_conf
create_srv_conf
create_loc_conf
对所有NGX_HTTP_MODULE预处理
NGX_HTTP_MODULE
根据配置文件处理http{}模块
对所有NGX_HTTP_MODULE未初始化项进行初始化
其他处理,还没看
7. ngx_http_core_module
ngx_http_core_module_ctx
ngx_http_core_preconfiguration
ngx_http_core_postconfiguration
ngx_http_core_create_main_conf
ngx_http_core_init_main_conf
ngx_http_core_create_srv_conf
ngx_http_core_merge_srv_conf
ngx_http_core_create_loc_conf
ngx_http_core_merge_loc_conf
ngx_http_core_commands
variables_hash_max_size
NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1
main_conf
variables_hash_bucket_size
server_names_hash_max_size
server_names_hash_bucket_size
server
NGX_HTTP_MAIN_CONF|NGX_CONF_BLOCK|NGX_CONF_NOARGS
ngx_http_core_server
ctx->配置项名称,及初始化配置内存commands->将各个配置项信息配置到ctx对应信息中
0 条评论
回复 删除
下一页