-
下载 nginx http://nginx-win.ecsds.eu/
-
配置 nginx.conf
-
使用三方工具配置 windows 服务 , 这里使用 winsw.exe https://github.com/winsw/winsw
-
将 winsw.exe 重命名为 nginx-service.exe
-
创建配置文件 nginx-service.xml
-
设置 xml
<service> <id>nginx</id> <name>nginx</name> <description>nginx</description> <executable>D:/nginx/nginx.exe</executable> <stopexecutable>D:/nginx/nginx.exe -s quit</stopexecutable> <stopparentprocessfirst>true</stopparentprocessfirst> <depend></depend> <logpath>D:/nginx/logs</logpath> <log mode="roll-by-time"> <pattern>yyyyMMdd</pattern> </log> </service>
-
使用
查看操作命令.\nginx-service.exe -h
-
安装 服务、启用 服务