nginx 知识点 :ctx_index and index
来源:互联网 发布:linux 终端 重启 编辑:程序博客网 时间:2024/06/05 02:56
struct ngx_module_s {
ngx_uint_t ctx_index;
ngx_uint_t ctx_index;
ngx_uint_t index;
……
};
index : 是所有模块在ngx_modules.c文件中的ngx_modules数组中的序号,它与ngx_modules数组中所有模块的顺序是一致的。
ngx_max_module =0;
for(i=0; ngx_modules[i]; i++)
{
ngx_modules[i]->index = ngx_max_modules++;
}
ngx_max_modules 是Nginx模块的总个数。
注意一点是: Nginx各模块在ngx_modules数组中的顺序是很重要的,依靠index成员,每一个模块才可以把自己的位置和其他模块进行比较,并以此决定行为。
同时,Nginx又允许再次定义子类型, ctx_index表明了模块在相同类型模块中的顺序
ngx_event_max_module =0;
for(i=0; ngx_modules[i]; i++)
{
if(ngx_modules[i]->type != NGX_EVENT_MODULE)
{
continue;
}
ngx_modules[i]->ctx_index = ngx_event_max_module++;
}
其中,ngx_event_max_module是编译进Nginx的所有事件模块的总个数。
总的来说,index就是该模块在所有Nginx模块中的序号, ctx_index是该模块在同一类模块中的序号
0 0
- nginx 知识点 :ctx_index and index
- nginx去掉index.php
- nginx配置root, index
- nginx 隐藏index.php
- nginx去掉index.html改为index.php
- Table and Index rebuild
- Table and Index Movement
- Index and Statistics
- max value and index
- DML command and Index
- mysql index and key
- recoll index and usage
- MySql key and index
- index and polymorphic
- elasticsearch index and store
- Clustered Index and Non-Clustered Index
- Bitmap index AND bitmap join index
- local index and global index [转]
- 数据结构(线性表):单循环链表
- MyBatis集成log4j简单配置
- 乱码终极解决大全(阅尽天下A片,心中便无码)
- python中numpy模块中的linspace函数
- Android Studio导入项目出错问题
- nginx 知识点 :ctx_index and index
- MyBatis的简单使用
- Spring Cloud 负载均衡后,某个服务挂掉后保证数据一致性
- POJ 3449 Geometric Shapes(判断几个不同图形的相交)
- 文件系统不一致导致找不到文件
- SpringBoot学习笔记(三) SpringBoot 自动配置原理
- 查询数据库客户信息显示在页面并进行相关操作
- android学习(十八) 添加动画(三) 显示卡片翻转动画
- 1019. General Palindromic Number (20)