编译安装nginx
1、安装perl
安装地址: https://strawberryperl.com,选择msi安装程序即可
2、安装sed for windows
下载地址:https://sourceforge.net/projects/gnuwin32/files/sed/,执行安装程序结束后,将安装包bin目录配置到环境变量下
3、安装visual studio 2022 community版
4、从https://github.com/nginx/nginx下载1.26.1版源码,在源码中新建目录objs\lib
下载nginx-http-flv-module:https://github.com/winshining/nginx-http-flv-module (1.2.10版)
下载pcre: https://github.com/PCRE2Project/pcre2/tags (10.2.39版)
下载zlib: https://github.com/madler/zlib (1.3.1版)
下载openssl:https://www.openssl.org/source/index.html (3.0.13版)
将nginx-http-flv-module、openssl、pcre、zlib拷贝到该目录中并解压
5、查看nginx编译参数
下载nginx-1.26.1已经编译完成的版本,执行 nginx.exe -V,得到如下结果:
configure arguments: --with-cc=cl --builddir=objs.msvc8 --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-o