1. Download the latest version of the Windows Service Wrapper program
Https://github.com/kohsuke/winsw/releases
2. You can modify its name, for example: Myapp.exe copy the renamed Myapp.exe to the Nginx installation directory
3. Create a Windows Service wrapper XML configuration file under the same Nginx directory, the name must match the name used when the first step is renamed (for example, I am "myapp.xml")
The contents of the Myapp.xml file are as follows:
<configuration>
<!--ID of the service. It should be unique accross the Windows system-->
<id>nginx</id>
<!--Display name of the service-
<name>nginx Service 1.12.2</name>
<!--Service Description-
<description>high Performance Nginx service</description>
<executable>C:\nginx\nginx.exe</executable>
</configuration>
4, under command line, execute the following command to install it as a Windows service.
d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Install
At this point, complete, confirm: My Computer right---management------Is there an nginx? Start Up,
Access http://localhost in the browser confirm, then stop the service, and then visit http://localhost confirm.
Add:
The command format for Windows Servcie wrapper is as follows:
# Installation Services
d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Install
# Uninstall Service
d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Uninstall
# Start Service
d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Start
# Stop Service
d:\neatbeanssofts\redis-x64-3.2.100> myapp.exe Stop
Windows Nginx to service self-boot