使用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