Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart nginx on OS X

I'm using nginx on OS X 10.8. Freshly installed nginx but can't find a way to restart nginx except kill nginx_pid say kill 64116. Wondering if there are better ways to restart nginx.

Found some methods on Google and SO but didn't work:

nginx -s restart  sudo fuser -k 80/tcp ; sudo /etc/init.d/nginx restart 

The error message for nginx -s restart is

nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory) 

Sometimes also get this error msg:

nginx: invalid option: "-s restart" 
like image 961
clwen Avatar asked Jan 05 '13 21:01

clwen


People also ask

How do I stop and start nginx on Mac?

The correct way to do this for Nginx installed via MacPorts: Start: sudo port load nginx. Stop: sudo port unload nginx.


1 Answers

Try running sudo nginx before starting nginx.

like image 99
Benjamin Crouzier Avatar answered Oct 04 '22 11:10

Benjamin Crouzier