How to stop nginx on Mac OS X

I've installed and configured nginx server on my Mac from MacPorts

  1. sudo port install nginx
  2. Followed the recommendation from the port installation console and created the launchd startup item for nginx, then started the server.
  3. Renamed nginx.conf.example to nginx.conf and renamed mime.types.example to mime.types.

It works fine, but I couldn't stop it.

I tried sudo nginx -s stop, but this doesn't stop the server, I can still see "Welcome to nginx!" page in my browser on http://localhost/; also I still see master and worker processes of nginx with ps -e | grep nginx.

What is the best way to start/stop nginx on Mac?

BTW, I've added "daemon off;" into nginx.conf - as recommended by various resources.


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

This command stops also stops nginx.

sudo nginx -s stop