ngix_http_stub_status_module

1.ngx_http_stub_status_module 是一个 Nginx 的内置 HTTP 模块,该模块能够提供 Nginx 的状态信息。默认状况下这个模块是不被编译进来的,因此在编译 Nginx 时要指定加载该模块--with-http_stub_status_modulenginx

2.首先检查nginx是否安装ngx_http_stub_status_module模块curl

若是没有安装,须要从新编译。测试

# nginx  -V | grep http_stub    url

ngx_http_stub_status_module (static)spa

# nginx   -vcode

Tengine version: Tengine/2.1.1 (nginx/1.6.2)server

 

3,首先在nginxserver段配置对应的信息requests

server {it

    listen  80;io

    server_name  xxx;

    location /ngx_status   自定义模块名称

    {

        stub_status on; 开启状态访问

        access_log off;

    #allow all;   能够设置须要那些主机访问

    #deny all;

    }

}

4,从新加载nginx,访问测试

# service nginx reload

 

curl 127.0.0.1:80/ngx_status

Active connections: 135  

server accepts handled requests request_time

 13711907 25715823 5175039843

Reading: 0 Writing: 12 Waiting: 123

说明:

Active connections: 135  #//正在活跃的链接数

server accepts handled requests  

13711907 25715823 5175039843          #处理了13711907次链接,建立25715823次握手,共5175039843请求。

Reading: 0 Writing: 1 Waiting: 1          # Reading:读取客户端header数,Writing:返回客户端header数,Waiting:请求完成,等待下一次链接。

相关文章
相关标签/搜索
本站公众号
   欢迎关注本站公众号,获取更多信息