nginx 1.22 windows版本编译
详情可参考官方编译说明: https://nginx.org/en/docs/howto_build_on_win32.html
- windows命令行进入msys2
vcvars64 msys2_shell -mingw64
- 克隆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
- 创建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
- 多线程编译
set CL=/MP8 nmake
- 编译完成
nginx.exe在objs目录下