nginx开启stub_status模块功能

Posted on Posted in nginx
Tips: 本文创建于2015年5月5日,已超过 2 年,内容或图片可能已经失效!

1、查看nginx是否加载了stub_status模块

nginx -V
nginx version: nginx/1.2.1
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-log-path=/var/log/nginx/access.log --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --lock-path=/var/lock/nginx.lock --pid-path=/var/run/nginx.pid --with-pcre-jit --with-debug --with-http_addition_module --with-http_dav_module --with-http_geoip_module --with-http_gzip_static_module --with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module --with-http_ssl_module --with-http_sub_module --with-http_xslt_module --with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail --with-mail_ssl_module --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-auth-pam --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-echo --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-upstream-fair --add-module=/tmp/buildd/nginx-1.2.1/debian/modules/nginx-dav-ext-module

2、在nginx配置server中加入

location /status {
?????? allow 127.0.0.1; //允许的IP
?????? deny all;
?????? stub_status on;
?????? access_log off;
}

访问 localhost/status

Active connections: 6
server accepts handled requests
 38125 38125 101482
Reading: 5 Writing: 1 Waiting: 0

Active connections:对后端发起的活动连接数。
Server accepts handled requests:Nginx总共处理了2个连接,成功创建2次握手(证明中间没有失败的),总共处理了6个请求。
Reading:Nginx 读取到客户端的Header信息数。
Writing:Nginx 返回给客户端的Header信息数。
Waiting:开启keep-alive的情况下,这个值等于 active – (reading + writing),意思就是Nginx已经处理完成,正在等候下一次请求指令的驻留连接。

» 转载请注明来源:呢喃 » nginx开启stub_status模块功能

One thought on “nginx开启stub_status模块功能

  1. Opera 26.0.1656.60 Opera 26.0.1656.60 Windows 7 Windows 7
    Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36 OPR/26.0.1656.60

    In fact when someone doesn’t be aware of then its
    up to other users that they will help, so here it occurs.

Comments are closed.