Hunter Ford Hunter Ford

Nginx Startup Script for Mac OS X

If you don't use MacPorts, and have a hard time finding a startup plist file for Nginx, and had trouble getting Nginx to startup with your custom plist file, this might be your solution:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">

Just save this as /Library/LaunchDaemons/org.nginx.nginx.plist and perform the following in a bash session:

sudo chown root:wheel /Library/LaunchDaemons/org.nginx.nginx.plist
sudo launchctl load /Library/LaunchDaemons/org.nginx.nginx.plist
sudo launchctl start org.nginx.nginx



  • Mat

    Example of brew plist for nginx 1.5: ------------------------------ Label org.nginx.nginx RunAtLoad KeepAlive UserName root ProgramArguments /usr/local/Cellar/nginx/1.0.5/sbin/nginx -g daemon off; WorkingDirectory /usr/local
  • Martin Stannard

    Nice tip, thanks! One issue though, you spelt Daemons wrong a few times. Make copy/paste a bit confusing, cheers, Martin