- 下载nginx
nginx: download
- 解压
比如D:\nginx
- 下载工具
Windows Service Wrapper
winsw-2.9.0-bin.exe
Index of releases/com/sun/winsw/winsw
- 配置
winsw-2.9.0-bin.exe改名为nginx-service.exe
创建配置文件nginx-service.xml,内容如下:
<service><id>nginx</id><name>Nginx Service</name><description>High Performance Nginx Service</description><logpath>D:\nginx\logs</logpath><log mode="roll-by-size"><sizeThreshold>10240</sizeThreshold><keepFiles>8</keepFiles></log><executable>D:\nginx\nginx.exe</executable><startarguments>-p D:\nginx</startarguments><stopexecutable>D:\nginx\nginx.exe</stopexecutable><stoparguments>-p D:\nginx -s stop</stoparguments>
</service>
- 安装
D:\nginx\nginx-service.exe install
- 卸载
D:\nginx\nginx-service.exe uninstall
- 查看
运行services.msc