1, download the latest version of the Windows Service Wrapper program, such as I download the name is "Winsw-1.9-bin.exe",
Then, name it as you want (for example: "Mynginx.exe", of course, you can also not rename)
2. Copy the downloaded file (winsw-1.9-bin.exe) to the Nginx directory (D:\nginx-1.12.2)
3. Create an XML configuration file for Windows Service wrapper with the same name (Winsw-1.9-bin.xml) under the Nginx directory
The contents of the file are as follows:
<service> <id>nginx</id> <name>Nginx Service</name> <description>High Performance Nginx Service</description> <logpath>D:\nginx-1.12.2\logs</logpath> <log mode="roll-by-size"> <sizeThreshold>10240</sizeThreshold> <keepFiles>8</keepFiles> </log> <executable>D:\nginx-1.12.2\nginx.exe</executable> <startarguments>-p D:\nginx-1.12.2</startarguments> <stopexecutable>D:\nginx-1.12.2\nginx.exe</stopexecutable> <stoparguments>-p D:\nginx-1.12.2\ -s stop</stoparguments></service>
Description
<name>Nginx Service</name> #这是服务里面名字<description>High Performance Nginx Service</description> #这里是对服务的描述
4. Command line Execution installation command
The command format for Windows Servcie wrapper is as follows:
#安装服务CMD:\> winsw-1.9-bin.exe install#卸载服务CMD:\> winsw-1.9-bin.exe uninstall#启动服务CMD:\> winsw-1.9-bin.exe start#停止服务CMD:\> winsw-1.9-bin.exe stop
#附个当时安装1. Pictures when version 8
Create a Windows service self-boot for Nginx