mac下使用brew安装nginx

安装

brew install nginx

启动

brew services start nginx

打开http://localhost:8080,看到这个页面说明启动成功

停止

brew services stop nginx

重启(会先stop,再start)

brew services restart nginx

重新加载配置(不会stop,只是重新加载配置)

nginx -s reload

验证nginx配置文件是否正确

nginx -t

配置文件位置

/usr/local/etc/nginx/nginx.conf