Mac/Homebrew查找nginx安裝目錄和nginx.conf配置文件目錄
1. nginx安裝目錄
2.nginx.conf配置文件目錄
3. 啓動/暫停/重載
1. nginx安裝目錄
$ ps -ef | grep nginx
1
安裝目錄就在:/usr/local/opt/nginx/bin/nginx,如下
zhangguoyedeMacBook-Pro:nginx zhangguoye$ ps -ef | grep nginx
501 1543 1 0 9 919 ?? 0:00.04 nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off;
501 1700 1543 0 9 919 ?? 0:00.00 nginx: worker process
501 37720 929 0 11:37上午 ttys006 0:00.00 grep nginx
1
2
3
4
2.nginx.conf配置文件目錄
$ nginx -t
1
配置文件目錄就在:/usr/local/etc/nginx/,如下
zhangguoyedeMacBook-Pro:nginx zhangguoye$ nginx -t
nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful
1
2
3
3. 啓動/暫停/重載
# 啓動
$ sudo brew services start nginx
# 暫停
$ nginx -s stop
# 重載
$ nginx -s reload