nginx
ArtNowBen
这个作者很懒,什么都没留下…
展开
-
nginx的location时怎么组织的
概述location的配置项,如"root",可以配置在http块、server块、location块,所以location的数据结构有三个层级。第一级在cycle->conf_ctx[HTTP]->loc_conf[i]第二级在cscf(ngx_http_core_srv_conf_t),cscf->ctx->loc_conf[i]第三级在clcf(ngx...原创 2019-11-07 21:51:36 · 140 阅读 · 0 评论 -
nginx对http头部的处理
数据结构 ngx_http_request_t{ ngx_http_headers_in_t headers_in; //存放分析后的request headers ngx_http_headers_out_t headers_out; //存放待发送的response headers ngx_chain_t ...原创 2019-11-03 18:57:31 · 870 阅读 · 0 评论 -
nginx:upstream的keep-alive是怎么实现的
数据结构//变量kcftypedef struct { ngx_uint_t max_cached; //keepalive参数,有多少ngx_http_upstream_keepalive_cache_t ngx_uint_t requests; //每个连接处理多少请...原创 2019-10-31 22:57:02 · 609 阅读 · 0 评论 -
nginx的upstream与算法是怎么组织的
upstream的数据结构ngx_http_upstream_main_conf_t { ngx_array_t upstreams; /* ngx_http_upstream_srv_conf_t* */}ngx_http_upstream_srv_conf_t { ngx_http_upstream_peer_t ...原创 2019-10-30 23:53:35 · 239 阅读 · 0 评论 -
nginx是怎么支持websocket的
nginx配置配置如下server { location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_pass http://web...原创 2019-10-30 22:14:43 · 414 阅读 · 0 评论 -
nginx的事件处理函数
1. 数据结构connection中有read/write两种事件struct ngx_connection_s { void *data; ngx_event_t *read; ngx_event_t *write; ...}struct ngx_event_s {... n...原创 2019-10-27 22:48:35 · 421 阅读 · 0 评论