nginx 1.22 windows版本编译

本文介绍了如何在Windows上编译nginx 1.22版本,包括进入msys2环境,克隆和解压nginx源码及模块,创建makefile以及进行多线程编译的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

nginx 1.22 windows版本编译

详情可参考官方编译说明: https://nginx.org/en/docs/howto_build_on_win32.html

  1. windows命令行进入msys2
    vcvars64
    msys2_shell -mingw64
    
  2. 克隆nginx源码目录,并解压已下载的模块源码
    http://hg.nginx.org/nginx/rev/af7a3fb7558f
    mkdir objs
    mkdir objs/lib
    cd objs/lib
    tar -xzf ../../pcre2-10.40.tar.gz
    tar -xzf ../../zlib-1.2.11.tar.gz
    tar -xzf ../../openssl-1.1.1s.tar.gz
    
  3. 创建makefile
    ./auto/configure --with-cc=cl --with-debug --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/pcre2-10.40 --with-zlib=objs/lib/zlib-1.2.11 --with-openssl=objs/lib/openssl-1.1.1s --with-openssl-opt=no-asm --with-http_ssl_module --with-stream --with-http_sub_module --with-http_auth_request_module --add-module=objs/lib/nginx-rtmp-module  --add-module=objs/lib/nginx-http-flv-module-master
    
  4. 多线程编译
    set CL=/MP8
    nmake
    
  5. 编译完成
    nginx.exe在objs目录下
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

北京中电慧视

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值