I can stop nginx server using nginx -s stop or nginx -s quit.

What is the difference?

up vote 26 down vote accepted

Quit is a graceful shutdown. Nginx finishes serving the open connections before shutdown

Stop is a quick shutdown where is terminates in between serving the connection

http://wiki.nginx.org/CommandLine

-s stop terminates the nginx process immediately while -s quit does a graceful shutdown.

SIGQUIT causes nginx to break if it listens on Unix domain sockets. It will fail to clean up sockets, then immediately terminate on next invocation because it can't create sockets at paths which already exist.

SIGTERM causes nginx to shut down into a consistent state from which it can start back up. The daemon removes any Unix domain sockets, leaves all caches in a usable state, and so forth.

You basically never want to use QUIT.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.