I have installed nginx via homebrew, by default it provides a plist which is symlinked from
~/Library/LaunchAgents and running
launchctl load ~/Library/LaunchAgents/nginx.plist starts nginx as my user account.
I want nginx to be able to listen on port 443 to test some HTTPS stuff. So this means running nginx as root. By placing the plist file in
/Library/LaunchAgents insetad I can run
sudo launchctl load ... and nginx starts and everything runs correctly.
However, in this scenario nginx isn’t started at boot time. I must manually start nginx after every reboot.
Is it possible to have launchctl start nginx as root at bootup?