定义在server和locationb标签中
源码编译安装需要加上该模块:--with-http_stub_status_module
1.定义
#vim /usr/local/nginx/conf/nginx.conf
location /status {
stub_status on;
access_log off;
}
#nginx -t
#nginx -s reload
2.访问
http://192.168.1.31/status
3.状态概述
Active connections:1 //Nginx当前活跃连接数
server accepts handled requests request_time
5 5 21 0
server //Nginx处理接收握手总次数。
accepts //表示Nginx处理接收总连接数。
//请求丢失数=(握手数-连接数)可以看出,本次状态显示没有丢失请求。
handled requests //表示总共处理了19次请求。
Reading //Nginx读取数据
Writing //Nginx写的情况
Waiting //Nginx开启keep-alive的连接情况下,既没有读也没有写,建立连接情况