校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > Nginx配置檢測服務狀態的實現方法

Nginx配置檢測服務狀態的實現方法

熱門標簽:百度地圖標注要不要錢 江蘇電銷外呼防封系統是什么 賀州市地圖標注app 金融行業外呼線路 高德地圖標注無營業執照 廣州電銷機器人系統圖 長沙開福怎么申請400電話 智能電話機器人線路 東莞人工智能電銷機器人供應商

1. 查看是否安裝檢查狀態模塊;

[root@localhost ~]# nginx -V
nginx version: nginx/1.12.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)
configure arguments: --prefix=/usr/local/nginx --with-http_sub_module

2.  如未安裝,重新編譯安裝;

Ø  檢查狀態模塊;--with-http_stub_status_module

[root@localhost ~]# cd /usr/local/src/nginx-1.12.2/       
[root@localhost ~]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module
[root@localhost ~]# make && make install

3. 編輯nginx 的配置文件;

[root@localhost ~]# vim /usr/local/nginx/conf/nginx.conf
server {
  listen 80;
  server_name localhost;
  #access_log logs/host.access.log main;
 
  location /nginx_status {
  stub_status on;
  access_log off;
   #allow 127.0.0.1; ##可對該頁面的訪問者進行過濾
   #deny all;
   }
  }
[root@localhost ~]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@localhost ~]# nginx -s reload

4.測試語法;

[root@localhost ~]# curl http://192.168.10.110:80/nginx_status
Active connections: 1
server accepts handled requests
 1 1 1
Reading: 0 Writing: 1 Waiting: 0

5.     輸出內容詳解;

第一行  Active connections: 1  ——活躍的連接數量,包括等待客戶端數0
第二行 server accepts handled requests —— 總共處理了1個連接 , 成功創建1次握手, 總共處理了1個請求
第三行 Reading — 讀取客戶端的連接數,Writing — 響應數據到客戶端的數量,Waiting — 開啟 keep-alive 的情況下,這個值等于 active – (reading+writing), 意思就是 Nginx 已經處理完正在等候下一次請求指令的駐留連接.

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

標簽:廊坊 洛陽 滄州 北京 松原 玉樹 張家界 永州

巨人網絡通訊聲明:本文標題《Nginx配置檢測服務狀態的實現方法》,本文關鍵詞  Nginx,配置,檢測,服務,狀態,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Nginx配置檢測服務狀態的實現方法》相關的同類信息!
  • 本頁收集關于Nginx配置檢測服務狀態的實現方法的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 天全县| 裕民县| 资源县| 永川市| 房产| 寿阳县| 九寨沟县| 济南市| 凯里市| 鸡东县| 正阳县| 天津市| 江山市| 秦皇岛市| 沙坪坝区| 上犹县| 逊克县| 虞城县| 恩平市| 台安县| 乌兰浩特市| 红原县| 平阴县| 江陵县| 阳曲县| 新巴尔虎左旗| 外汇| 景谷| 六盘水市| 新巴尔虎左旗| 施甸县| 临朐县| 长兴县| 冀州市| 湛江市| 阳原县| 霞浦县| 山丹县| 阿荣旗| 三明市| 莒南县|