Installing Nginx
Download the Windows Nginx (Http://nginx.org/download/nginx-1.10.0.zip) and unzip to the location you want to place (D:\xampp\nginx)
Set Nginx as a Windows service
Need to use the "Windows Service Wrapper" gadget, Project address: HTTPS://GITHUB.COM/KOHSUKE/WINSW
: Http://repo.jenkins-ci.org/releases/com/sun/winsw/winsw/1.18/winsw-1.18-bin.exe
After downloading the tool, place it in the Nginx installation directory, rename it to Nginx-service.exe, create the configuration file Nginx-service.xml (the name is the same as the tool name),
Create Nginx-service.exe.config (NET 2.0 runtime is supported by default for NET 4.0 runtime)
The file structure is as follows:
Nginx-service.xml content is as follows:
<service> <id>nginx</id> <name>nginx service</name> <description>high Performan Ce Nginx service</description> <logpath>D:\xampp\nginx\logs</logpath> <log mode= "Roll-by-size" > <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <ex Ecutable>d:\xampp\nginx\nginx.exe</executable> <startarguments>-p D:\xampp\nginx</ Startarguments> <stopexecutable>D:\xampp\nginx\nginx.exe</stopexecutable> <stoparguments>-p D:\xampp\nginx-s stop</stoparguments> </service>
Nginx-service.exe.config content is as follows:
<configuration> <startup> <supportedruntime version= "v2.0.50727"/> <supportedruntime versi on= "v4.0"/> </startup> <runtime> <generatepublisherevidence enabled= "false"/> </runtim E> </configuration>
Run the following command in CMD to install the Windows service
D:\xampp\nginx\nginx-service.exe Install
You can then start the service in the Windows Services panel.
The browser will be able to access the
Website: http://blog.csdn.net/weixin_37288522/article/details/70576409
Window how to let Nginx boot from the boot