1、打开终端
2、安装Command Line tools
xcode-select --install |
3、安装brew命令
|
1
|
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
4、安装nginx
|
1
|
brew install nginx |
5、启动nginx
|
1
|
sudo nginx |
OK, nginx就安装好了,可以在浏览器访问了,默认端口为8080,
在浏览器输入 http://localhost:8080/ 就能看到nginx在本计算机搭建的服务器
原文:https://www.cnblogs.com/wanjun-top/p/12730877.html