首先可以从百度网盘下载nginx文件包:
链接:https://pan.baidu.com/s/1XP1jXBfFLmyOeAi3cMkvOw?pwd=re0z  提取码:re0z

安装脚本如下:

@echo off
 chcp 65001echo 参数设置
 echo.
 set cds=%~dp0
 echo 当前目录:%cds%echo ****************************************
 echo.
 echo 安装nginx,请不要关闭窗口
 echo.
 echo.
 echo 请以管理员身份运行
 echo.
 echo ****************************************echo 参数设置
 echo.
 set cdsf=%cds:\=/%
 set sign=${base}
 set nginxpath=%cdsf%nginx
 echo nginx目录:%nginxpath%
 set teamplatefile=%nginxpath%/conf/nginx.conf.template
 echo 模版目录:%teamplatefile%
 set configfile=%nginxpath%/conf/nginx.conf
 set configfileremove=%cds%nginx\conf\nginx.conf
 echo 模版目录:%configfile%
 echo 模版删除目录:%configfileremove%
 set servertemplatefile=%cds%nginx\nginx-service.xml.template
 echo 服务模版目录:%servertemplatefile%
 set serverfile=%cds%nginx\nginx-service.xml
 echo 服务文件目录:%serverfile%echo 删除旧配置文件
 echo.
 if exist %configfileremove% del %configfileremove%
 if exist %serverfile% del %serverfile%echo 生成配置文件
 echo.
 setlocal enabledelayedexpansion
 for /f "tokens=*" %%i in (%teamplatefile%) do (
 set s=%%i
 set s=!s:%sign%=%cds%!
 if not [!s!]==[] echo !s!>>%configfile%
 )for /f "tokens=*" %%j in (%servertemplatefile%) do (
 set t=%%j
 set t=!t:%sign%=%cds%!
 if not [!t!]==[] echo !t!>>%serverfile%
 )echo 安装nginx服务
 %cds%nginx\nginx-service.exe install
 sc start hzsidp_nginx exit