Nginx 常用命令

date
Aug 5, 2021 12:02 PM
Related to 日程数据 1 (blog)
tags
Nginx
Bash
slug
12
summary
nginx
启动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
配置文件路径 /usr/local/etc/nginx/nginx.conf

© lewoking 2021 - 2022