在windows下用winsw把nginx当成服务运行

前端之家收集整理的这篇文章主要介绍了在windows下用winsw把nginx当成服务运行前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

1. 下载winsw

https://github.com/kohsuke/winsw/releases


2. 配置winsw.xml,把winsw放在Nginx同一目录

<configuration>
  <id>Nginx</id>
  <name>Nginx</name>
  <description>Nginx</description>
  <executable>%BASE%/Nginx.exe</executable>
  <stopexecutable>%BASE%/Nginx.exe -s stop</stopexecutable>
  <logpath>%BASE%/logs/</logpath>
  <logmode>roll</logmode>
  <depend></depend>
</configuration>
3.安装,以管理员身份启动cmd

winsw install

winsw uninstall //卸载

4.启动、关闭服务

net start Nginx

net stop Nginx

猜你在找的Windows相关文章