nginx常用命令以及详解

nginx是一款比较火的一个反向代理工具,也可用来做负载均衡是一款比较火的一个中间键应用软件。所以对他的日常维护也是不可避免的。

nginx version: nginx/1.14.2
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : 帮助
  -v            : 显示版本后退出
  -V            : 显示版本和相关操作后退出show version and configure options then exit
  -t            : 测试配置后退出
  -T            : 测试配置,将其转​​储并退出 test configuration, dump it and exit
  -q            : 在配置测试期间抑制非错误消息suppress non-error messages during configuration testing
  -s signal     : 向主进程发送信号:停止,退出,重新打开,重新加载 send signal to a master process: stop, quit, reopen, reload
  -p prefix     : 设置前缀(默认路径类似于NGINX_HOME)路径set prefix path (default: /usr/local/nginx-1.14.2/)
  -c filename   : 设置配置文件set configuration file (default: conf/nginx.conf)
  -g directives : 设置除了文件配置以外的全局指令set global directives out of configuration file

参数 官方解释 翻译
-h this help 帮助
-v show version and exit 显示版本信息
-V show version and configure options then exit 显示版本信息和配置信息
-t test configuration and exit 检查配置文件语法
-T test configuration, dump it and exit
-q suppress non-error messages during configuration testing
-s signalsend signal to a master process: stop, quit, reopen, reload 控制服务平滑重启 停止
-p prefix set prefix path (default: /etc/nginx/)
-c filename set configuration file (default: /etc/nginx/nginx.conf)
-g directives set global directives out of configuration file

nginx -c ./conf/nginx.conf  #加载指定配置文件的同时启动nginx
nginx -s stop #关闭nginx
nginx -s quit #退出nginx
nginx -s reopen #重启
nginx -s reload #重新加载配置文件
nginx -t #检查配置文件的语法问题

最后一句话作者的翻译能力不咋地,以上有些翻译全是个人经验理解所得不要嘲笑😝。如果理解上有错误请劳烦指正。感谢🙏

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值