How To Set Up Nginx Server Blocks (Virtual Hosts) - Step-by-step
Programmers Lab Programmers Lab
395 subscribers
69 views
0

 Published On Jan 17, 2024

Thanks for watching. like this page and support.
https://www.facebook.com/Programmers-...

/usr/local/etc/nginx (Intel Macs) or /opt/homebrew/etc/nginx (M1/M2/M3 Macs)

which nginx - to find the installation path

/opt/homebrew/etc/nginx/nginx.conf - for M1/M2/M3 Macs
/usr/local/etc/nginx/nginx.conf - for Intel Macs

server {
listen 80;
server_name test.com;

location / {
root /path/to/your/website; # Replace with your website's root directory
index index.html index.htm;
}
}

sudo nano /etc/hosts

127.0.0.1 test.com

sudo nginx -s reload

show more

Share/Embed