比如要添加第三方流量监控模块nginx-module-vts
1、官网
找个合适的zip包下载,这里给给0.2.2版本的下载链接
wget https://github.com/vozlt/nginx-module-vts/archive/refs/tags/v0.2.2.zip
3-1、解压zip包
unzip v0.2.2.zip
3-2 、如果报错./configure: error: C compiler cc is not found
yum -y install gcc gcc-c++ autoconf automake make pcre-devel zlib-devel openssl openssl-devel GeoIP-devel.x86_64
4、编译nginx且添加第三方模块
./configure \
--prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-stream=dynamic \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_gunzip_module \
--with-http_flv_module \
--with-http_mp4_module \
--pid-path=/run/nginx.pid \
--lock-path=/run/ningx.lock \
--with-http_geoip_module \
--with-http_auth_request_module \
--with-http_secure_link_module \
--http-log-path=/data/logs/nginx/access.log \
--error-log-path=/data/logs/nginx/error.log \
--with-debug \
--with