网上有很多关于在windows server系统下安装Ngnix,并设置为win服务的教程,经过实践,发现了一种相对更完美的方法,记录如下:
1.进入http://nginx.org/en/docs/windows.html,下载Nginx windows版。本文使用的是1.13.5版。
2.进入https://github.com/kohsuke/winsw,下载winsw,用于将Ngnix安装为windows服务。本文使用的是winsw-v2.1.2 net4版,需要先安装.Net Frameworks 4.0。
3.下载sample-minimal.xml(见上图),内容修改如下:
<configuration>
<!-- ID of the service. It should be unique accross the Windows system-->
<id>Nginx</id>
<!-- Display name of the service -->
<name>Nginx Service (powered by WinSW)</name>
<!-- Service description -->
<description>This service is