第一步:下载Nginx
下载 官网:https://nginx.org/en/download.html
下载Windows Service Wrapper
下载 官网:https://repo.jenkins-ci.org/artifactory/releases/com/sun/winsw/winsw/
配置
假设nginx解压到目录:D:\Applications\WebServer\nginx-1.18.0
将下载下的winsw.exe放到位置D:\Applications\WebServer\nginx-1.18.0,然后在该路径下创建文件winsw.xml:
注意:
必须解压到Nginx根目录

<service><id>nginx</id><name>nginx</name><description>nginx Web Server</description><executable>D:\Applications\nginx1.26.2\nginx.exe</executable><stopexecutable>D:\Applications\nginx1.26.2\nginx.exe -s stop</stopexecutable><logpath>D:\Applications\nginx1.26.2\logs</logpath><logmode>roll</logmode></service>
运行
打开命令行工具,在其中执行
winsw.exe install
,回车,提示安装服务完成。
版权归原作者 梁云亮 所有, 如有侵权,请联系我们删除。