一、nginx配置
配置location
location /nginx_status {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
stub_status on;
access_log off;
allow 183.49.46.196; # 允許訪問的 IP
allow 127.0.0.1;
deny all;
}
二、效果
nginx status詳解
active connections – 活躍的連接數量
server accepts handled requests — 總共處理了91835569個連接 , 成功創建91835569次握手, 總共處理了454138306個請求
reading — 讀取客戶端的連接數.
writing — 響應數據到客戶端的數量
waiting — 開啓 keep-alive 的情況下,這個值等於 active – (reading+writing), 意思就是 Nginx 已經處理完正在等候下一次請求指令的駐留連接.