Nginx配置文件详解(2)

本文详细解析了如何开启Nginx的状态界面并利用Zabbix监控Nginx服务器状态。首先介绍了在Nginx服务器上安装Zabbix_agent客户端的过程,然后在Zabbix服务端添加主机,并编写监控脚本来检查Nginx状态。重点关注了'reading'和'waiting'两个状态指标,解释了它们对服务器性能的影响,并展示了如何修改zabbix_agentd.conf文件和验证监控效果。
摘要由CSDN通过智能技术生成

Nginx配置文件详解(2)

开启状态界面

[root@localhost ~]# nginx -V
nginx version: nginx/1.20.1
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=nginx --group=nginx --with-debug --with-http_ssl_module --with-http_realip_module --with-http_image_filter_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_stub_status_module --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --add-module=../echo-nginx-module-0.61
在编译nginx的时候安装相应的软件包--with-http_gzip_static_module,然后去配置文件中添加内容,最后去浏览器中去访问即可
[root@localhost conf]# pwd
/usr/local/nginx/conf
[root@localhost conf]# vim nginx.conf
//添加一下三行内容
        location /status {   
                stub_status;
}
 ......
[root@localhost conf]# nginx -s reload

去网页查看
在这里插入图片描述

状态页面信息详解:

状态码 表示的意义
Active connections 2 当前所有处于打开状态的连接数
accepts 总共处理了多少个连接
handled 成功创建多少握手
requests<
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值