学习资料欢迎大家下载https://t.zsxq.com/imimAYF
安装
在编译nginx之前,编译选项里加上:
--with-http_stub_status_module
因为nginx默认是不安装改模块的。
配置
在nginx.conf里,server下面,加入配置:
location /nginx_status {
# copied from http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/
stub_status on;
access_log off;
allow all; # allow SOME.IP.ADD.RESS;比如 allow 202.106.1.60;
# deny all;
}
重载配置
nginx -s reload
访问nginx的性能统计页面
http://xxxx.com/nginx_status/
结果如下:
解释
Active connections: 1
server accepts handled requests
49894 49894 340975
Reading: 0 Writing: 1 W