@@ -5,58 +5,59 @@ echo string
55
66## Nginx Version
77Nginx1.0.10 https://github.com/nginx/nginx/releases/tag/release-1.0.10
8- ![ image ] ( https://wx1.sinaimg.cn/large/005LOzcmly1fgimmvpk3sj30mi04p3z9.jpg )
8+ ![ nginx1.0.10.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc07b90e28.png )
99
1010## The development environment configuration
1111``` shell
1212OS : CentOS Linux release 7.2.1511 (Core)
1313```
14- ![ image ] ( https://wx4.sinaimg.cn/large/005LOzcmly1fgimnlvhh0j30s106imxw.jpg )
15- ![ image ] ( https://wx4.sinaimg.cn/large/005LOzcmly1fgimnlwy1fj315u0dwdhn.jpg )
14+ ![ Server_info.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc07b5dff4.png )
15+ ![ Server_CPU_info.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc0825053e.png )
1616
1717## Install a clean compile Nginx
18181 . Download a Nginx10.10 and unpack it
19- ![ image ] ( http ://wx2.sinaimg.cn/large/005LOzcmly1fgimq77ahwj30pw05et9n.jpg )
19+ ![ nginx1.0.10.png ] ( https ://ooo.0o0.ooo/2017/06/13/593fc07cd07e2.png )
2020
21212 . Install the GCC and the lib Nginx need
22- ![ image ] ( https://wx4.sinaimg.cn/large/005LOzcmly1fgimv0hryoj30pd06djs8.jpg )
23- ![ image ] ( https://wx4.sinaimg.cn/large/005LOzcmly1fgimva84bbj30pa07fgms.jpg )
22+ ![ install_GCC.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc06152dd0.png )
23+ ![ Nginx_lib.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc078c3c2b.png )
2424
25253 . ./configure --prefix=/usr/local/nginx && make && make install
26- ![ image] ( https://ws2.sinaimg.cn/large/005LOzcmly1fgimvz2rfkj30j10av75w.jpg )
27- ![ image] ( https://wx2.sinaimg.cn/large/005LOzcmly1fgimw6cmh2j30ur06n757.jpg )
28- ![ image] ( https://ws4.sinaimg.cn/large/005LOzcmly1fgimwezp9tj30qu0fdn0a.jpg )
26+ ![ configure_ok.png] ( https://ooo.0o0.ooo/2017/06/13/593fc061b5a9f.png )
27+ ![ make && make install.png] ( https://ooo.0o0.ooo/2017/06/13/593fc074c9b29.png )
28+ ![ nginx_install_ok.png] ( https://ooo.0o0.ooo/2017/06/13/593fc080db608.png )
29+
29304 . Nginx run
30- ![ image ] ( https://wx3.sinaimg.cn/large/005LOzcmly1fgimy3dkk5j30rr05ddh5.jpg )
31- ![ image ] ( https://ws1.sinaimg.cn/large/005LOzcmly1fgimyc58d3j31vk0qsq9y.jpg )
31+ ![ start_nginx.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc08044567.png )
32+ ![ nginx_install_ok.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc080db608.png )
3233
3334## Definition module configuration structure
3435``` C
3536typedef struct {
3637 ngx_str_t ed; //该结构体定义在这里 https://github.com/nginx/nginx/blob/master/src/core/ngx_string.h
3738} ngx_http_echo_loc_conf_t ;
3839```
39- ![ image ] ( https://wx2.sinaimg.cn/large/005LOzcmly1fgin4at3rsj30rp04g74r.jpg )
40+ ![ define_moudle_conf.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc0615456f.png )
4041
41- #Define Nginx instruction and parameter conversion function
42- ![ image ] ( https://wx1.sinaimg.cn/large/005LOzcmly1fgjdis37udj30xj0bktan.jpg )
42+ ## Define Nginx instruction and parameter conversion function
43+ ![ 定义指令和参数转化函数.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc0529132f.png )
4344
4445## definition module Context
45461 . Define the type of ngx_http_module_t structure variables
46- ![ image ] ( https://wx3.sinaimg.cn/large/005LOzcmly1fgjer4wtrxj313u09igo7.jpg )
47+ ![ 定义注入点结构体.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc052953a4.png )
47482 . Initialize a configuration structure
48- ![ image ] ( https://wx1.sinaimg.cn/large/005LOzcmly1fgjerqnq71j30zd08fmyd.jpg )
49+ ![ 初始化一个配置结构体.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc05277601.png )
49503 . Will the father block configuration information incorporated into this structure Implement the configuration of inheritance
50- ![ image ] ( https://wx3.sinaimg.cn/large/005LOzcmly1fgjes12fy5j30ya08qgn7.jpg )
51+ ![ 合并父block的配置信息.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc0528ec4a.png )
5152
5253## Write the Handler really work part of the module
53- ![ image ] ( https://ws2.sinaimg.cn/large/005LOzcmly1fgjfosnvf5j31hy0q6wlb.jpg )
54+ ![ Nginx模块handler.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc0616a385.png )
5455
5556## Combination Nginx module
56- ![ image ] ( https://ws2.sinaimg.cn/large/005LOzcmly1fgjjo2l11jj31en0g4gq1.jpg )
57+ ![ 组合Nginx Module.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc052aa29a.png )
5758
5859## Finishing module code According to the Nginx official specification
59- ![ image ] ( https://ws2.sinaimg.cn/large/005LOzcmly1fgjnxy9ikvj31yx12jwr3.jpg )
60+ ![ ok_file.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc061b7d7a.png )
6061
6162## Write the config file
6263``` shell
@@ -69,18 +70,19 @@ NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/src/ngx_http_echo_module.c"
6970 ./configure --prefix=/usr/local/nginx/ --add-module=/root/ngx_dev && make && make install
7071```
7172## Successful installation
72- ![ image ] ( https://ws3.sinaimg.cn/large/005LOzcmly1fgjnvxyqx4j30w40f0tbw.jpg )
73+ ![ make install.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc052be07d.png )
7374
7475## Modify the Nginx configuration file test Module
75- ![ image ] ( https://ws2.sinaimg.cn/large/005LOzcmly1fgjnz17rh7j30jl07yaai.jpg )
76+ ![ test module.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc0614f91a.png )
7677
7778## Nginx echo Module The successful running
78- ![ image ] ( https://ws2.sinaimg.cn/large/005LOzcmly1fgjo0r1a5dj30yf06tmxv.jpg )
79+ ![ module ok.png ] ( https://ooo.0o0.ooo/2017/06/13/593fc05292b08.png )
7980
8081# If the repo help you welcome star fork Thanks!
8182
8283> ## reference
8384> 1 . http://wiki.nginx.org/Configuration
8485> 2 . http://tengine.taobao.org/book/
8586> 3 . ** http://blog.codinglabs.org/articles/intro-of-nginx-module-development.html **
86- > 4 . https://www.nginx.com/resources/wiki/modules/
87+ > 4 . https://www.nginx.com/resources/wiki/modules/
88+
0 commit comments