Install NGINX:
brew install nginx
Start NGINX (as background service):
brew services start nginx
sudo nginx # to start for first time
Move to macOS config location and create symlink so it can be accessed like Ubuntu with cd /etc/nginx
cd /usr/local/etc/nginx
sudo ln -s ../../usr/local/etc/nginx/ .
.... (what actually worked ↓)
cd /etc
sudo ln -s /opt/homebrew/etc/nginx .
Create sites-available
and sites-enabled
directories:
mkdir sites-available sites-enabled
Connect sites-enabled
by adding the following line inside the http
block in /usr/local/etc/nginx/nginx.conf
include sites-enabled/*;
Test configuration and restart with:
# Test
sudo nginx -t
# Reload
sudo nginx -s reload