Welcome! Log In Create A New Profile

Advanced

Correctly setup Nginx on Windows as a Service

Posted by misterdai 
Correctly setup Nginx on Windows as a Service
October 16, 2009 09:23AM
Hi,

I've managed to correctly get Nginx running as a Windows Service. Other methods I've see using the Microsoft tools "instsrv/srvany" or FireDaemon don't stop the process correctly and even though it stops the main process it leaves an additional "nginx.exe" process running. You can imagine that after a few service restarts you'll have quite a few orphan processes lying around.

My method was to use a tool "Windows Service Wrapper" to execute "nginx -s stop" on a stop or restart. This causes nginx to shutdown properly and means no more orphaned processes.

I've posted the full details on my blog [url]http://misterdai.wordpress.com/2009/10/16/nginx-windows-service/[/url]

I hope people find it useful. Hopefully Nginx will one day have native Windows service support and this will no longer be needed, but I just couldn't wait for that day to come ;)

Enjoy

My blog: http://misterdai.wordpress.com
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 179
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready