1.Download Nginx

1.1 Mainline version or Stable version



2. Download WinSW

Download WinSW

2.1 Rename winsw-2.2.0-bin.exe (custom name, take nginx-service.exe as an example)

2.2 Add XML file must have the same name as the EXE file

<? The XML version = "1.0" encoding = "utf-8"? > <service> <id>nginx</id> <name>nginx</name> <description>Nginx Startup</description> <logpath>C:/Program Files/nginx - 1.17.7 / logs/winsw < / logpath > < logmode > roll < / logmode > < the executable > C: / Program Exe Files/nginx - 1.17.7 / nginx. < / the executable > < startargument > -p < / startargument > < startargument > C: / Program Files/nginx - 1.17.7 < / startargument > < stopargument > -p < / stopargument > < stopargument > C: / Program Files/nginx - 1.17.7 < / stopargument > < stopargument > -s < / stopargument > < stopargument > stop < / stopargument > < / service >

Be sure to separate the commands, or the system will report 1067 error when starting the service

2.3 Enter the command nginx-service.exe install under the file path

2.4 After successful installation

Enter the startup command net start nginx

The stop command net stop nginx