一句簡單命令重啟nginx

2021-08-30 12:35:14 字數 935 閱讀 1726

最近我的多個vps經常出現502錯誤,經常需要重啟nginx,但網上的很多教程都需要繁瑣的啟動指令碼,遠不如apache的重啟命令那麼簡單。

但研究了一下nginx幫助後發現,有-s引數可對nginx服務進行管理:

# /usr/local/nginx/sbin/nginx-h

nginxversion:nginx/0.7.63

usage:nginx[-?hvvt] [-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

-s signal : send signal to a master process: stop, quit, reopen, reload

-p prefix : set prefix path (default: /usr/local/nginx/)

-c filename : set configuration file (default: conf/nginx.conf)

-g directives : set global directives out of configuration file

於是我執行

# /usr/local/nginx/sbin/nginx-s  reload

nginx已經重啟成功

一句簡單命令重啟nginx

最近我的多個vps經常出現502錯誤,經常需要重啟nginx,但網上的很多教程都需要繁瑣的啟動指令碼,遠不如apache的重啟命令那麼簡單。但研究了一下nginx幫助後發現,有 s引數可對nginx服務進行管理 usr local nginx sbin nginx h nginxversion ng...

每日一句功能簡單實現

每天自動獲取最新一條。封裝了下 def get today word today datetime.date.today word word.objects.filter add time year today.year,add time month today.month,add time day...

python第一句 第一句python

內部執行過程 python內部執行過程如下 內容編碼 python直譯器在載入.py檔案中的 時,會對內容進行編碼 預設ascill ascii american standard code for information interchange,美國標準資訊交換 是基於拉丁字母的一套電腦編碼系統,...