无论是编译安装还是yum安装 都是有可能加载http_stub_status_module模块
--with-http_stub_status_module
主要用于查看Nginx的一些状态信息.
模块的语法格式,
Syntax: stub_status
Default: -
Context: server,location
这个模块的作用于只能在server,location段。
在server段中添加一个status就可以了,注意这个status是随意起的名字,然后保存从其nginx服务。
[root@VM_159_140_centos www]# vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location /status{
stub_status on;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
访问127.0.0.1/status
页面的参数介绍
Active connections: 1
server accepts handled requests
20 20 69
Reading: 0 Writing: 1 Waiting: 0
Active connections: 1当前活动的连接数
20 总连接数connection
20 成功的连接数connection 失败连接=(总连接数-成功连接数)
69 总共处理的请求数requests
Reading: 0 读取客户端Header的信息数 请求头
Writing: 1 返回给客户端的header的信息数 响应头
Waiting: 0 等待的请求数,开启了keepalive