?
wget http://nginx.org/download/nginx-1.20.1.tar.gz
本次编译的时候指定使用http_stub_status_module和http_ssl_module
tar -zxvf nginx-1.20.1.tar.gz
cd nginx-1.20.1/
配置编译使用的模块
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
编译
make
make install
cd /usr/local/nginx/sbin/
./nginx
curl localhost
cd /u01/nginx-1.20.1/
[root@load-eco nginx-1.20.1]# ./configure --help | grep dynamic
--with-http_xslt_module=dynamic enable dynamic ngx_http_xslt_module
--with-http_image_filter_module=dynamic
enable dynamic ngx_http_image_filter_module
--with-http_geoip_module=dynamic enable dynamic ngx_http_geoip_module
--with-http_perl_module=dynamic enable dynamic ngx_http_perl_module
--with-mail=dynamic enable dynamic POP3/IMAP4/SMTP proxy module
--with-stream=dynamic enable dynamic TCP/UDP proxy module
--with-stream_geoip_module=dynamic enable dynamic ngx_stream_geoip_module
--add-dynamic-module=PATH enable dynamic external module
--with-compat dynamic modules compatibility
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-stream=dynamic
注意,此时只需要make即可,不要执行make install
make
在编译后,在/u01/nginx-1.20.1/objs中会有编译好的 ngx_stream_module.so模块,此时只需要将模块复制到nginx的工作目录即可,如果在nginx目录中没有modules也可以自己建立一个
cp ngx_stream_module.so nginx_worker_dir/modules/
load_module modules/ngx_stream_module.so;
stream {
....
}
https://nginx.org/en/docs/configure.html
https://nginx.org/en/docs/stream/ngx_stream_core_module.html
?
CentOS7.6下安装nginx1.20.1及nginx动态模块使用
原文:https://www.cnblogs.com/GYoungBean/p/15128007.html