Nginx - 命令行常用参数
执行sbin/nginx -h 列出nginx命令支持的参数说明
root@andre:/home/nginx# sbin/nginx -?
nginx version: nginx/1.16.1
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]
Options:
-?,-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 signal : send signal to a master process: stop, quit, reopen, reload
-p prefix : set prefix path (default: /home/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
- 帮助命令 -?,-h
- 展示版本信息 -v 展示版本信息与编译信息 -V
- 测试配置信息是否有语法错误 -t -T ,如果加上-q 非错误信息不会展示
- 给master进程发送信号 -s ; stop 立即停止 quit 优雅停止服务 reopen 重新打开日志文件 reload 重新加载配置文件
- 制定进程运行目录 -p
- 指定运行配置文件 -c
- 在配置文件之外,指定全局的指令 -g