How to stop nginx on Mac OS X

Solution 1:

# nginx -h
...
-s signal     : send signal to a master process: stop, quit, reopen, reload
...

Solution 2:

This command stops also stops nginx.

sudo nginx -s stop 

Solution 3:

The correct way to do this for Nginx installed via MacPorts:

  • Start: sudo port load nginx
  • Stop: sudo port unload nginx

OS X uses launchd so the process of starting/stopping daemons is slightly different.


Solution 4:

Look at the PID of master process and do

kill -QUIT <master_pid>

Solution 5:

You may try the following:

ps -lef|grep -i nginx:|awk '{ print $2}'|xargs kill -9