双击nginx.exe文件
访问http://localhost:80看到如下页面说明nginx服务正常启动了。
<configuration>
<startup>
<supportedRuntime version="v2.0.50727" />
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<generatePublisherEvidence enabled="false"/>
</runtime>
</configuration>
3. 创建nginx-service.xml文件(根据实际情况对路径进行调整)
<service>
<id>nginx</id>
<name>Nginx Service</name>
<description>High Performance Nginx Service</description>
<logpath>C:\Program Files\Nginx\logs</logpath>
<log mode="roll-by-size">
<sizeThreshold>10240</sizeThreshold>
<keepFiles>8</keepFiles>
</log>
<executable>C:\Program Files\Nginx\nginx.exe</executable>
<startarguments>-p C:\Program Files\Nginx</startarguments>
<stopexecutable>C:\Program Files\Nginx\nginx.exe</stopexecutable>
<stoparguments>-p C:\Program Files\Nginx -s stop</stoparguments>
</service>
nginx-service.exe install
sc delete 服务名称