windows下编译nginx

前言:客户检测出2以下rtmp推流模块,报安全问题,需要升级版本才能清除。

一准备

  • msys2
  • zlib
  • pcre
  • openssl
  • nginx-http-flv
  • ActivePerl
  • nasm

资源地址

里面有所需要准备的编译文件,与编译好的nginx,可以直接用
百度网盘

开始编译

  1. 在nginx源码目录中新建目录objs\lib,将nginx-http-flv-module、openssl、pcre、zlib拷贝到该目录中并解压。
  2. 在这里插入图片描述

在这里插入图片描述

  1. 运行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

运行msys在这里插入图片描述
如果报错 在 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  

在这里插入图片描述

之后就生成完成了
在这里插入图片描述

  • 6
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值