Running nginx on Windows as a Service
Nginx is one of my favorite webservers, very simple and very fast with loads of features. If you are in a Windows environment and still want to use nginx there is nothing stopping you since the nginx team offer a Windows Binary Download. The only problem is that is just an executable, no install required which is good, but sadly no service either.
Solving this problem is very easy to do though.
The only thing you need is a tool called WinSW. Download here.
Put it in the same folder as you keep the nginx executable and rename it to nginx-winsw.exe
Create a xml document called nginx-winsw.xml
<service>
 <id>nginx</id>
 <name>nginx</name>
 <description>nginx</description>
 <executable>e:\nginx\nginx.exe</executable>
 <logpath>e:\nginx\</logpath>
 <logmode>roll</logmode>
 <depend></depend>
 <startargument>-p e:\nginx</startargument>
 <stopargument>-p e:\nginx -s stop</stopargument>
</service>
Next run this command to create the service.
.\nginx-winsw.exe install
Now you should have a service called nginx that you need to just start.
















