Ho installato Nginx usando homebrew e dopo aver completato l'installazione è stato visualizzato il seguente messaggio:
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.
If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You'll need to turn off
any other web servers running port 80, of course.
You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp #{prefix}/org.nginx.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist
Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http's default of 80.)
Ma voglio Nginx, sulla porta 80, in esecuzione al login e non voglio aprire il terminale e digitare sudo nginx
per farlo. Voglio che si carichi da un file plist come fanno Redis e PostgreSQL.
Ho spostato il plist /Library/LaunchAgents/
dall'equivalente della cartella utente e ho cambiato la sua proprietà, ho anche provato a impostare la user
direttiva nel nginx.conf
file e comunque lo stesso messaggio di errore in Console.app:
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
(insieme a un altro messaggio che mi diceva che dato che nginx
era stato eseguito senza privilegi di superutente, la user
direttiva veniva ignorata)