Skip to content

Instantly share code, notes, and snippets.

@martdn
Last active November 18, 2019 05:42
Show Gist options
  • Save martdn/0236f0b0da925ee0578f9e1667e3bc35 to your computer and use it in GitHub Desktop.
Save martdn/0236f0b0da925ee0578f9e1667e3bc35 to your computer and use it in GitHub Desktop.
[Homebrew] Nginx configuration for Mac
  brew install nginx
  ln -sfv /usr/local/opt/nginx/*.plist ~/Library/LaunchAgents
  launchctl load ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
  • mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
  • cd /usr/local/etc/nginx/sites-enabled
  • ln -s ../sites-available/default.conf
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment