Before start you should ensure that you have Command Line Tools installed in your mac. It is part of XCode. You should have it installed and updated.
Install Command Line Tools if not exist
xcode-select --install
Install Nginx using Homebrew
brew tap homebrew nginx brew install nginx
Test Installation
## Start Nginx
sudo nginx
## Check if Nginx is running on 8080 port
curl -IL http://127.0.0.1:8080
Output should look like this
HTTP/1.1 200 OK Server: nginx/1.12.1 Date: Tue, 10 Feb 2021 22:11:39 GMT Content-Type: text/html Content-Length: 138 Last-Modified: Tue, 10 Feb 2021 21:49:46 GMT
Connection: keep-alive ETag: “5a07545a-8a”
Accept-Ranges: bytes
Also you can open http://127.0.0.1:8080 in your browser. You should get the next page
Nginx installed successful.
That’s it for now.
If you liked this article, then please subscribe to my YouTube Channel for video tutorials.