nginx-http-echo-module 介绍
nginx-http-echo-module 是使用C语言开发一个原生的Nginx拓展,为了学习Nginx模块和Nginx内核。
nginx_module_echo
使用echo指令输出一个字符串
Nginx1.0.10
https://github.com/nginx/nginx/releases/tag/release-1.0.10
OS : CentOS Linux release 7.2.1511 (Core)
typedef struct { ngx_str_t ed; //该结构体定义在这里 https://github.com/nginx/nginx/blob/master/src/core/ngx_string.h} ngx_http_echo_loc_conf_t;
ngx_addon_name=ngx_http_echo_moduleHTTP_MODULES="$HTTP_MODULES ngx_http_echo_module"NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_echo_module.c"
./configure --prefix=/usr/local/nginx/ --add-module=/root/ngx_dev && make && make install