Nginx not started, homebrew says it is Nginx not started, homebrew says it is nginx nginx

Nginx not started, homebrew says it is


Because nginx is going to start at port 80, it needs to be root. LaunchAgents are run as non-root user when that user logs in. LaunchDaemons are loaded at boot as root user.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist

Move the homebrew.mxcl.nginx.plist

sudo mv ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist /Library/LaunchDaemons/

Load the plist from the LaunchDaemons folder

sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.nginx.plist

Now, sudo brew services list shows a running nginx process

Name    Status  User  Plistnginx   started root  /Library/LaunchDaemons/homebrew.mxcl.nginx.plist

Running brew services list without root will result in an error status, because you need to be root to read the status.


As said, this happens because port 80 is reserved, it needs to be root.

An easier way is run brew services with sudo

sudo brew services start nginx