Skip to content

Instantly share code, notes, and snippets.

@ldong
Created April 18, 2017 06:15
Show Gist options
  • Save ldong/f1f526aef341028d5db30436a8816575 to your computer and use it in GitHub Desktop.
Save ldong/f1f526aef341028d5db30436a8816575 to your computer and use it in GitHub Desktop.

Nginx

Docroot is: /usr/local/var/www

The default port has been set in /usr/local/etc/nginx/nginx.conf to 8080 so that nginx can run without sudo.

nginx will load all files in /usr/local/etc/nginx/servers/

  • Tips -
Run port 80:
 $ sudo chown root:wheel /usr/local/opt/nginx-full/bin/nginx
 $ sudo chmod u+s /usr/local/opt/nginx-full/bin/nginx
Reload config:
 $ nginx -s reload
Reopen Logfile:
 $ nginx -s reopen
Stop process:
 $ nginx -s stop
Waiting on exit process
 $ nginx -s quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment