Skip to content

Instantly share code, notes, and snippets.

@mnlcandelaria
Created January 18, 2020 17:20
Show Gist options
  • Save mnlcandelaria/9db1d342bcf1d8e7891523ce896e8da0 to your computer and use it in GitHub Desktop.
Save mnlcandelaria/9db1d342bcf1d8e7891523ce896e8da0 to your computer and use it in GitHub Desktop.
brew install nginx
sudo nginx
sudo nginx -s stop
mv /usr/local/etc/nginx/nginx.conf /usr/local/etc/nginx/nginx.conf.bak
cp /usr/local/etc/nginx/nginx.conf.bak /usr/local/etc/nginx/nginx.conf
# add include conf.d/*.conf; on /usr/local/etc/nginx/nginx.conf
http {
# ... ...
# ... ... nginx stuff
# ... ...
# include all server conf files
include conf.d/*.conf;
}
mkdir /usr/local/etc/nginx/conf.d
vim /usr/local/etc/nginx/conf.d/myweb.conf
server {
listen 8080;
server_name myweb.local;
location / {
root /var/www/html/myweb/public/;
index index.html index.htm;
}
# redirect server error pages to the static page /50x.html
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
sudo vim /private/etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
# mywebsite
127.0.0.1 myweb.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment