Windows 安装nginx并开机启动

Win安装nginx并 开机启动

下载nginx安装包 nginx-1.12.2.zip,解压到D盘。

 https://pan.baidu.com/s/1InQa527yq35Q68c73RBb-A#list

下载 nginx-service.exe  和 nginx-service.xml 文件;

 https://pan.baidu.com/s/1InQa527yq35Q68c73RBb-A#list


【 nginx-service.xml 文件内容为:
<service>
<id>nginx</id>
<name>nginx</name>
<description>nginx</description>
<env name="path" value="D:/nginx-1.12.2"/>
<executable>D:/nginx-1.12.2/nginx.exe</executable>
<arguments>-p D:/nginx-1.12.2</arguments>
<logpath>D:/nginx-1.12.2/logs/</logpath>
<logmode>roll</logmode>
</service>


执行 nginx-service.exe
【在 cmd 中 nginx文件夹下执行 nginx-service.exe install 】


执行 service.msc 查看 系统服务,有了nginx服务。

 

重启并测试访问nginx已经开机自启动。

原文地址:https://www.cnblogs.com/wgy1/p/8690122.html