The Web service has been deployed on the Linux platform, but a recent project, which has to be used by Windows, has been forced to look again at Nginx's performance under Windows, because Apache httpd is not really good at windows, and I prefer nginx.
Surprised to find Nginx has stabilized under Windows, so I decided to use Nginx as a Web server.
To the Nginx download page, you can find the corresponding version is available for download: http://nginx.org/en/download.html.
When the download is complete, place it in the specified directory, such as D:\nginx.
To install Nginx as a service, we need to use a software:Windows Service Wrapper, this software is also open source, and has not been updated for a long time, I found the last version is 1.9. Need Baidu.
After downloading, copy the winsw-1.9-bin.exe file to the Nginx WINSW folder (not created).
Create an XML file with the same name,winsw-1.9-bin.xml content as follows:
<?XML version= "1.0" encoding= "UTF-8"?><Service><ID>Nginx</ID><name>Nginx</name><Description>Nginx</Description><executable>D:\nginx\nginx.exe</executable><LogPath>D:\nginx\</LogPath><LogMode>Roll</LogMode><depend></depend><startargument>-P D:\nginx</startargument><stopargument>-P D:\nginx-s Stop</stopargument></Service>
Run cmd as administrator, input:D:\nginx\winsw\winsw-1.9-bin.exeInstall, enter, prompt installation service complete.
At this point, your nginx can be run as a Windows service, you can open the Service Manager to start, stop, modify the automatic or manual operation, etc., you can also use the Windows cmd command:net Start/stop nginx to manage. Isn't it convenient?
I have consulted this article: http://blog.163.com/[email protected]/blog/static/38702877201361952417699/
Installing Nginx into Windows System services under Windows Server R2