Mac/Homebrew查找nginx安装目录和nginx.conf配置文件目录

青旅半醒 2024-04-19 08:57 144阅读 0赞

Mac/Homebrew查找nginx安装目录和nginx.conf配置文件目录

    1. nginx安装目录
  • 2.nginx.conf配置文件目录
    1. 启动/暂停/重载

1. nginx安装目录

  1. $ ps -ef | grep nginx

安装目录就在:/usr/local/opt/nginx/bin/nginx,如下

  1. zhangguoyedeMacBook-Pro:nginx zhangguoye$ ps -ef | grep nginx
  2. 501 1543 1 0 9 919 ?? 0:00.04 nginx: master process /usr/local/opt/nginx/bin/nginx -g daemon off;
  3. 501 1700 1543 0 9 919 ?? 0:00.00 nginx: worker process
  4. 501 37720 929 0 11:37上午 ttys006 0:00.00 grep nginx

2.nginx.conf配置文件目录

  1. $ nginx -t

配置文件目录就在:/usr/local/etc/nginx/,如下

  1. zhangguoyedeMacBook-Pro:nginx zhangguoye$ nginx -t
  2. nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok
  3. nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful

3. 启动/暂停/重载

  1. # 启动
  2. $ sudo brew services start nginx
  3. # 暂停
  4. $ nginx -s stop
  5. # 重载
  6. $ nginx -s reload

发表评论

表情:
评论列表 (有 0 条评论,144人围观)

还没有评论,来说两句吧...

相关阅读