一、ngix安装为windows服务
1.网站下载windows版,http://nginx.org/en/download.html,我下的是1.9.15
2.解压至本地磁盘
3.下载Windows Service Wrapper(winsw.exe),解压至ngix相同目录
4.相同目录下新建文件winsw.xml,内容如下:
<?xml version="1.0" encoding="UTF-8" ?>
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<executable>D:
ginx
ginx.exe</executable>
<logpath>D:
ginx</logpath>
<logmode>roll</logmode>
<depend></depend>
<startargument>-p D:
ginx</startargument>
<stopargument>-p D:
ginx -s stop</stopargument>
</service>
5.安装服务,命令行winsw install
6.开启服务,winsw start