事先下载的源代码
1. nginx源代码
打开网站
下载zip文件
2.从GitHub上下载 nginx-http-flv-module
https://github.com/winshining/nginx-http-flv-module
准备上述5个zip
将nginx解压到一个文件夹,如下图
新建objs文件夹
在objs文件夹中,新建lib文件夹,将nginx-http-flv-module,PCRE, zlib 和OpenSSL 解压到此处
要用的软件
MSYS2 MSYS
visual studio 系列,我这里用的2017
config
打开MSYS2 MSYS,使用cd命令来到nginx文件夹下,执行以下命令
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/pcre-8.43 \ --with-zlib=objs/lib/zlib-1.2.11 \ --with-openssl=objs/lib/openssl-1.1.1c \ --with-openssl-opt=no-asm \ --add-module=objs/lib/nginx-http-flv-module \ --with-http_ssl_module \
这里要注意objs文件夹下的路径要写对,如果下载版本和我的不一致,需要对应修改文件名
出现上述即表示成功。
Nmake
从开始找到
“适用于 VS 2017 的 x86 本机工具命令提示”
英文版本的VS叫
“x86 Native Tools Command Prompt for VS 2017”
打开后,来到nginx目录,输入nmake
编译完成后,如下所示
而且,你还可以在objs里,找到nginx.exe
将nginx.exe复制到nginx目录下,即可使用