微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐