Install Nginx on Mac OS X
Run Nginx locally and play with basic configs
Install with brew
First of all your brew will run updates
Nevermind if you get an error, rerun the command.
Check your nginx installed
nginx -h
You should see
To check you nginx version
nginx -v
Run nginx
sudo nginx
Check that it runs
ps aux | grep nginx
You should see something like
Or simply in your browser go
- here#1 http://localhost:8080
- here#2 http://127.0.0.1:8080
what is the same.
Stop nginx
sudo nginx -s stop
Nginx configs
Basic configuration file is here /usr/local/etc/nginx/nginx.conf.
So you can vim it or subl.
vim /usr/local/etc/nginx/nginx.conf
subl /usr/local/etc/nginx/nginx.conf
That’s mine initial nginx.conf
What Next?
You can read how to config multiple sites on your local here.
I regularly add other posts. If you want to be notified you can also subscribe here.
Thank you for your attention
Thank you for your attention.
Do you need help with web and mobile development? Feel free to contact me here.
P.S. I really appreciate your like or share 🙏.