title: Nginx常用命令
author: Tomatoro
comments: true
tags:
- Nginx
top: 0
abbrlink: 96d8af1a
date: 2019-10-23 11:28:24
启动nginx
nginx
关闭nginx
nginx -s stop
退出nginx
nginx -s quit
重启nginx
nginx -s reload
使用brew下载nginx
brew install nginx
查看目前执行的任务
brew services list
进入nginx 文件
cd /usr/local/etc/nginx
查看nginx的配置
vi nginx.conf
查看nginx配置有没有生效
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
启动nginx服务
brew services start nginx
重启nginx服务
brew services restart nginx
停止nginx服务
brew services stop nginx
查看是否启动
ps -ef|grep nginx
0 63206 1 0 5:21下午 ?? 0:00.00 nginx: master process nginx
-2 63274 63206 0 5:23下午 ?? 0:00.01 nginx: worker process
501 65848 62966 0 5:52下午 ttys001 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn nginx
停止当前master的服务
sudo kill -QUIT 63206