1. Download the latest version of the Windows Service Wrapper program
: http://download.java.net/maven/2/com/sun/winsw/winsw/1.9/
2. Copy the downloaded file (winsw-1.9-bin.exe) to the Nginx directory (D:\nginx-1.4.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:
The contents of the file are as follows: <?xml version= "1.0" encoding= "UTF-8"?><service> <id>nginx</id> <name>nginx </name> <description>nginx</description> <executable>d:\nginx-1.4.2\nginx.exe</ executable> <logpath>D:\nginx-1.4.2\</logpath> <logmode>roll</logmode> <depend> </depend> <startargument>-p d:\nginx-1.4.2</startargument> <stopargument>-p D:\nginx-1.4.2 -S Stop</stopargument></service>4, command line execute installation command the command format for Windows Servcie Wrapper is as follows: # Installation Services cmd:\> Winsw-1.9-bin.exe Install # Uninstall Service cmd:\> winsw-1.9-bin.exe Uninstall # Start service cmd:\> winsw-1.9-bin.exe start # Stop service cmd:\ > Winsw-1.9-bin.exe Stop Reference article:
Enable Nginx to boot from Windows service
Http://www.myhack58.com/Article/sort099/sort0100/2012/33838.htm