MacBook安装Nginx

brew search nginx  //搜索软件 查询要安装的软件是否存在

brew install nginx 安装nginx

brew  uninstall nginx 卸载nginx

brew services start nginx 启动nginx服务


brew services stop nginx 关闭nginx服务

brew info nginx 查看安装信息(经常用到, 比如查看安装目录等)

brew list 查看已经安装的软件

brew update 升级brew

nginx -v 查看版本

nginx -V 查看版本,以及配置文件地址

sudo nginx  启动nginx 

nginx -s reload 重新加载nginx

sudo nginx -s stop  停止nginx

浏览器访问 http://127.0.0.1:8080/ 会显示 Welcome to nginx!