摘要: 目标:在nginx模块中,创建变量,而且赋值 ,能够在配置文件中直接通过变量值获取值。1.在readconf阶段,插入变量值: 保存对应的index值,以后使用。 value[1]为变量的名字。 ngx_http_variable_t *v; ngx_int_t index; ngx_str_t *value; value = static_cast<ngx_str_t*>(cf->args->elts); v = ngx_http_add_variable(cf, &value[1] , NGX_HTTP_VAR_CHANGEABLE); if (v = 阅读全文
posted @ 2011-02-21 09:59 梁星 阅读(4731) 评论(0) 推荐(0) 编辑
摘要: 大方法: 模块使用C++ 编译。 nginx服务器也需要使用C++编绎。1.在模块中,extern "C" {#include <ngx_config.h>#include <ngx_core.h>#include <ngx_http.h>}引入"C"模块。2.在objs/Makefile中,修改,CPP = g++LINK = $(CPP)其中,对于该模块,使用$(CPP)进行编绎。3.如果觉得麻烦,需要每次configure之后都要再修改的话,可以直接修改源码目录下 auto/make 里的CPP = g++LINK = g++和将# the add 阅读全文
posted @ 2011-02-21 09:43 梁星 阅读(5167) 评论(0) 推荐(1) 编辑
Mobile and Web Analytics