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 #檢查配置文件的語法問題

最後一句話作者的翻譯能力不咋地,以上有些翻譯全是個人經驗理解所得不要嘲笑😝。如果理解上有錯誤請勞煩指正。感謝🙏

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章