打开要修改主机文件的主机文件:
sudo vim hosts 2.添加域名映射
127.0.0.1 localhost 255.255.255.255 broadcast host 336033601 localhost #本地域名映射127.0.0.1 www.lzl.com 2
服务器{ listen 80; #监听端口font color=redserver _ namewww.lzl.com; /font # ip或域名# access _ loglogs/host.access.log main; 位置/{ # root/usr/local/cellar/nginx/1.19.10/JD /; # index jd.html; # } error _ page 500502503504/50x.html; # location=/50x.html { root html; }3.访问认证浏览器输入: www.lzl.com