1. 安装Nginx,终端下执行:
2. 启动nginx服务
3. 查看Nginx版本
4. nginx文件目录
打开访达,shift + command + g 输入文件路径,可直接查看文件
nginx安装文件目录
/usr/local/Cellar/nginx
nginx配置文件目录
/usr/local/etc/nginx
config文件目录
/usr/local/etc/nginx/nginx.conf
系统hosts位置
/private/etc/hosts
5. nginx常用命令
nginx #启动nginx
nginx -s quit #快速停止nginx
nginx -V #查看版本,以及配置文件地址
nginx -v #查看版本
nginx -s reload|reopen|stop|quit #重新加载配置|重启|快速停止|安全关闭nginx
nginx -h #帮助
7. 卸载nginx
brew uninstall nginx
参考文件:https://www.jianshu.com/p/026… https://www.jianshu.com/p/5c23b09d443f