We all know that Windows service is a special kind of application, it has the advantage of being able to run in the background, relatively, more suitable for some applications that need to run without too much user intervention, which we call "service", There is a very useful tool under Windows called WSW, we only get an EXE, or a bat, but want him to run like a service.
WSW Click to download
Place the downloaded windowsservicewrapper under the Nginx directory and create an XML file with the same name as shown in
The contents of the XML file are as follows:
<?XML version= "1.0" encoding= "UTF-8"?> <Service> <ID>Nginx</ID> <name>Nginx Service</name> <Description>Nginx Service</Description> <Envname= "path"value= "c:/nginx/nginx-1.13.6" /> <executable>C:/nginx/nginx-1.13.6/nginx.exe</executable> <LogPath>c:/nginx/nginx-1.13.6/logs/</LogPath> <LogMode>Roll</LogMode> <arguments>-P C:\Nginx\nginx-1.13.6</arguments></Service>
Finally, run cmd into c:/nginx/nginx-1.13.6, execute Nginx-service install, and execute Nginx-service Uninstall if you need to uninstall.
Creating Nginx as a Windows system service using WSW