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