安装
brew install nginx
如果执行安装报下面的错误:
Error: Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
MacBook-Pro:ueditor-1.4.3.3 mac$ sudo brew install nginx
执行下面的命令:
sudo chown -R `whoami` /usr/local/Homebrew/
sudo chown -R $(whoami) $(brew --prefix)/*
sudo mkdir /usr/local/Frameworks
sudo chown -R `whoami` /usr/local/Frameworks/
查看 nginx 版本
nginx -v
查看Nginx信息
brew info nginx
启动 nginx
nginx
查看 nginx 是否启动成功
在浏览器中访问http://localhost:8080,如果出现如下界面,则说明启动成功.
关闭nginx
nginx -s stop
重新加载nginx
nginx -s reload
查看Nginx配置文件
vim /usr/local/etc/nginx/nginx.conf