使用echo指令輸出一個字符串nginx
Nginx1.0.10 https://github.com/nginx/nginx/releases/tag/release-1.0.10
git
OS : CentOS Linux release 7.2.1511 (Core)
下載 Nginx10.10 而且解壓它
github
安裝gcc和Nginx須要的lib
函數
./configure --prefix=/usr/local/nginx && make && make install
測試
運行Nginx
spa
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模塊的指令和參數轉化函數
3d
ngx_addon_name=ngx_http_echo_module HTTP_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
千鋒PHP-PHP培訓的實力派code