Nginx命令行常用參數(2)

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

  1. 幫助命令 -?,-h
  2. 展示版本信息 -v 展示版本信息與編譯信息 -V
  3. 測試配置信息是否有語法錯誤 -t -T ,如果加上-q 非錯誤信息不會展示
  4. 給master進程發送信號 -s ; stop 立即停止 quit 優雅停止服務 reopen 重新打開日誌文件 reload 重新加載配置文件
  5. 制定進程運行目錄 -p
  6. 指定運行配置文件 -c
  7. 在配置文件之外,指定全局的指令 -g
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章