zoukankan      html  css  js  c++  java
  • nginx常用模块(状态模块)

    语法

    Syntax: stub_status;
    Default: —
    Context: server, location

    server {
        listen 80;
        server_name www.test.com;
        
        location / {
            root /code;
            index index.html;
        }
        location /download {
            root /code;
            index index.html;
            autoindex on;
            autoindex_exact_size off;
            autoindex_localtime on;
            allow all;
            auth_basic on;
            auth_basic_user_file /etc/nginx/auth_basic;
        }
        location /status {
            stub_status;
        }
    }

     

    #访问 http://www.test.com/status
    
    #返回内容
    Active connections: 2 
    server accepts handled requests
               2      2             1 
    Reading: 0 Writing: 1 Waiting: 1 
    
    #nginx七种状态
    Active connections        #活跃的连接数
    accepts                   #接受的TCP连接数
    handled                   #已处理的TCP连接数
    requests                  #请求数
    Reading                   #读取的请求头的数量
    Writing                   #响应的请求头的数量
    Waiting                   #等待的请求数量

    [root@web02 /etc/nginx/conf.d]# curl -s www.test.com/status| awk 'NR==3{print $3}'
  • 相关阅读:
    第二天课程档案
    第一天课程档案
    SAM初步
    计算几何初步
    数论二次总结
    生成函数入门题汇总
    1500: [NOI2005]维修数列
    20170214
    【bzoj2286】[Sdoi2011]消耗战
    bzoj2223: [Coci 2009]PATULJCI
  • 原文地址:https://www.cnblogs.com/chenlifan/p/13560932.html
Copyright © 2011-2022 走看看