ngx_http_stub_status_module是一个Nginx的内置 HTTP模块,该模块可以提供Nginx的状态信息。编译的时候 需指定加载该模块:
--with-http_stub_status_module
实例:
server {
listen 80;
server_name test.test.com;
location / {
proxy_pass http://opc_pools;
}
location /nstu {
stub_status on;
access_log off;
#allow 172.16.50.0/24;
allow xx.x3.x79.x8;
deny all;
} }
http://test.test.com/nstu
Active connections: 1 #活跃的连接数量
server accepts handled requests request_time
305060 305060 197548 93334511 #服务器接受的连接数:305060 服务器已处理的连接数:305060 服务器已除理的请求:93334511
Reading: 0 Writing: 1 Waiting: 0
#nginx 读取的请求头次数为0
#Nginx 读取请求体、处理请求并发送响应给客户端的次数为1
#当前活动的长连接数0