nginx源码分析-各模块说明


ngx_core_module 核心模块
ngx_errlog_module 日志模块 为什么叫errlog呢?
ngx_conf_module 配置模块, 主要是解决配置文件并存储到相应的conf_t中
ngx_events_module 事件模块
ngx_event_core_module 该模块也是ngx_event.c里,主要定义conf文件的event块里的东西
ngx_epoll_module epoll模块,采用epoll模型来工作,最主要利用ngx_event_actions_t定义的handler来处理epoll的工作,包括初始化,加入event,加入conn等
ngx_regex_module 正则模块
ngx_http_module http主模块,对应/src/http/ngx_http.c,最主要是ngx_http_block这个函数,该函数处理了ngx_http_module_t定义的http_module的几个handler
ngx_http_core_module http核心处理模块,主要处理http{...}里的命令
ngx_http_log_module 为什么这里还有一个log模块呢,这是专门处理http的访问日志的,而/core/ngx_errlog_module是处理系统级日志的.像access_log、log_format都在这里处理
ngx_http_upstream_module 上游代理模块,处理配置文件的upstream 和 server命令
ngx_http_static_module
ngx_http_autoindex_module 目录浏览模块,是否打开目录浏览
ngx_http_index_module 主文件处理模块
ngx_http_auth_basic_module 访问验证模块
ngx_http_access_module allow或deny 模块, 主要是拒绝那些ip不能访问或是所有都不能访问该location
ngx_http_limit_conn_module 限制连接模块, limit_zone来设置session的容器大小 
ngx_http_limit_req_module 最高并发模块
ngx_http_geo_module    
ngx_http_map_module 映射模块
ngx_http_split_clients_module  
ngx_http_referer_module 前一个页面模块,可以用来做防盗链
ngx_http_rewrite_module rewrite模块,就是重写
ngx_http_proxy_module 代理模块
ngx_http_fastcgi_module fastcgi处理模块
ngx_http_uwsgi_module
ngx_http_scgi_module
ngx_http_memcached_module memcache处理模块,可以反向到后端的memcache服务器,获取memcache的数据返回给客户端
ngx_http_empty_gif_module
ngx_http_browser_module
ngx_http_upstream_ip_hash_module
ngx_http_upstream_least_conn_module
ngx_http_upstream_keepalive_module
ngx_http_stub_status_module stub模块,查看nginx当前的一些状态,如活动连接数,总请求数等


以下是过滤模块
ngx_http_write_filter_module 最后输出给用户的过滤模块
ngx_http_header_filter_module 始终打开,用来将所有header组成一个完整的HTTP头。
ngx_http_chunked_filter_module 默认打开,对于HTTP/1.1和缺少content-length的回复自动打开
ngx_http_range_header_filter_module 默认打开,只是响应头过滤函数,用来解析range头,并产生range响应的头。
ngx_http_gzip_filter_module 默认关闭,支持流式的压缩内容
ngx_http_postpone_filter_module 始终打开,用来将子请求和主请求的输出链合并
ngx_http_ssi_filter_module 默认关闭,过滤SSI请求,可以发起子请求,去获取include进来的文件
ngx_http_charset_filter_module 默认关闭,可以添加charset,也可以将内容从一种字符集转换到另外一种字符集,不支持多字节字符集。
ngx_http_userid_filter_module 默认关闭,可以添加统计用的识别用户的cookie。
ngx_http_headers_filter_module 始终打开,可以设置expire和Cache-control头,可以添加任意名称的头
ngx_http_copy_filter_module 始终打开,只是响应体过滤函数, 主要工作是把文件中内容读到内存中,以便进行处理。
ngx_http_range_body_filter_module 默认打开,只是响应体过滤函数,支持range功能,如果请求包含range请求,那就只发送range请求的一段内容。
ngx_http_not_modified_filter_module 默认打开,如果请求的if-modified-since等于回复的last-modified间值,说明回复没有变化,清空所有回复的内容,返回304。 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值