install nginx:

brew install nginx

Use the brew services command to start Nginx:

brew services start nginx

to see all running services managed by Homebrew:

brew services list

Open your browser and go to http://localhost:8080.

By default, the Homebrew installation configures Nginx to listen on port 8080.

Once you have Nginx up and running, the next step is to modify its configuration file to point to your websites.

Nginx configuration files on macOS are located in /usr/local/etc/nginx/nginx.conf