homebrew安装
链接: homebrew安装报错:curl: Failed to connect to raw.githubusercontent.com port 443 after xxx ms解决办法
nginx安装
链接: Mac 安装Nginx详细教程
使用brew安装nginx
brew install nginx
页面访问 http://localhost:8080 验证是否安装成功
如上面的截图,From:xxx 这样的,是nginx的来源,Docroot默认为 /opt/homebrew/var/www, 在/opt/homebrew/etc/nginx/nginx.conf 配置文件中默认的端口为8080, 且nginx将在/opt/homebrew/etc/nginx/servers 目录中加载所有文件。并且我们可以通过最简单的命令’nginx’ 来启动nginx
启动nginx服务,如下命令:
cd /opt/homebrew/etc/nginx/servers/
nginx
验证是否安装成功,页面访问 http://localhost:8080