Windows 添加nginx到服务
一、下载nginx
地址:http://nginx.org/en/download.html (稳定版)
解压到相应的磁盘,本文是:E:\nginx\nginx-1.18.0
二、添加服务
<service><id>nginx</id>
<name>Nginx Service</name>
<description>High Performance Nginx Service</description>
<logpath>E:\nginx\nginx-1.18.0\logs</logpath>
<log mode="roll-by-size">
<sizeThreshold>10240</sizeThreshold>
<keepFiles>8</keepFiles>
</log>
<executable>E:\nginx\nginx-1.18.0\nginx.exe</executable>
<startarguments>-p E:\nginx\nginx-1.18.0</startarguments>
<stopexecutable>E:\nginx\nginx-1.18.0\nginx.exe</stopexecutable>
<stoparguments>-p E:\nginx\nginx-1.18.0 -s stop</stoparguments>
</service>
<configuration><startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
最后用cmd命令进入到nginx目录安装服务
卸载服务命令: sc delete 服务名
以上是 Windows 添加nginx到服务 的全部内容, 来源链接: utcz.com/a/66758.html