前言:客户检测出2以下rtmp推流模块,报安全问题,需要升级版本才能清除。
一准备
- msys2
- zlib
- pcre
- openssl
- nginx-http-flv
- ActivePerl
- nasm
资源地址
里面有所需要准备的编译文件,与编译好的nginx,可以直接用
百度网盘
开始编译
- 在nginx源码目录中新建目录objs\lib,将nginx-http-flv-module、openssl、pcre、zlib拷贝到该目录中并解压。
- 运行msys 进入到 nginx-f366007dd23a目录 执行
auto/configure --with-cc=cl --prefix= --conf-path=conf/nginx.conf --pid-path=logs/nginx.pid --http-log-path=logs/access.log --error-log-path=logs/error.log --sbin-path=nginx.exe --http-client-body-temp-path=temp/client_body_temp --http-proxy-temp-path=temp/proxy_temp --http-fastcgi-temp-path=temp/fastcgi_temp --http-scgi-temp-path=temp/scgi_temp --http-uwsgi-temp-path=temp/uwsgi_temp --with-cc-opt=-DFD_SETSIZE=1024 --with-pcre=objs/lib/pcre-8.45 --with-zlib=objs/lib/zlib-1.3 --with-openssl=objs/lib/openssl-1.1.0l --with-select_module --with-http_ssl_module --with-http_sub_module --with-http_v2_module --add-module=objs/lib/nginx-http-flv-module
如果报错 在 auto/cc/msvs 新增NGX_MSVC_VER=19.00
修改nginx\auto\lib\openssl\makefile.msvc 文件
将ms\do_ms 改为ms\do_nasm:
以管理远运行vs 切换到nginx目录执行 nmake -f objs/Makefile 命令
nmake -f objs/Makefile
之后就生成完成了