nginx-http-echo-module 介绍
Nginx-http-echo-module 是使用C语言开发一个原生的Nginx拓展,为了学习Nginx模块和Nginx内核。
Nginx_module_echo
Nginx 版本
Nginx1.0.10
https://github.com/nginx/nginx/releases/tag/release-1.0.10
OS : CentOS Linux release 7.2.1511 (Core)
-
下载 Nginx10.10 并且解压它
-
安装gcc和Nginx需要的lib
-
./configure –prefix=/usr/local/Nginx && make && make install
-
运行Nginx
typedef struct { ngx_str_t ed; //该结构体定义在这里 https://github.com/Nginx/Nginx/blob/master/src/core/ngx_string.h} ngx_http_echo_loc_conf_t;
定义echo模块的指令和参数转化函数
-
初始化一个配置结构体
组合Nginx Module
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
Nginx echo Module 运行成功
nginx-http-echo-module 官网
https://github.com/wujunze/nginx-http-echo-module
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。