nginx 添加http_stub_status_module模块


Posted in Servers onMay 25, 2022

1. stub_status 作用说明

编译选项 作用
–with-http_stub_status_module Nginx的客户端状态

2.查看现有 nginx 编译参数

./nginx -V
# 如果没有我们需要的模块,例如本次试验添加的 –with-http_stub_status_module ,那么则需要重新编译安装一下

nginx 添加http_stub_status_module模块

3.使用参数重新配置configure,在原有基础上添加上 --with-http_stub_status_module

configure 文件是在安装包目录下的文件,具体可参考 centos 7 安装 nginx

./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_ssl_module --with-pcre --with-stream --with-http_stub_status_module

4.将原来的 nginx 文件备份

cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak

5. 编译

make
# 这里是需要 make 编译,不用 make install

6. 替换nginx二进制文件

# 找到 nginx 安装包目录 /root/nginx-1.10.1/objs ,将 nginx 文件复制到原本的 /usr/local/nginx/sbin/nginx
cp /root/nginx-1.10.1/objs/nginx /usr/local/nginx/sbin/

nginx 添加http_stub_status_module模块

7.重新启动nginx,查看编译参数

./nginx -s reload
./nginx -V

8. 参考官网

地址:https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html

8.1 修改配置文件

文件目录:/usr/local/nginx/conf

nginx 添加http_stub_status_module模块

# 在文件中添加新的 location
location /nginx_status {
	stub_status;
}

# 解释说明:
	nginx_status	这是自定义命名的,访问的时候添加这个字段访问
	stub_status;	这个是固定参数

nginx 添加http_stub_status_module模块

8.2 浏览器访问

http://192.168.169.131/nginx_status
# 访问内容结果如下图

nginx 添加http_stub_status_module模块

# 解释说明:
1)Active connections-活跃连接数
        The current number of active client connections including Waiting connections.

(2)accepts-已接受的客户端连接总数
        The total number of accepted client connections.

(3)handled-已处理的连接总数
        The total number of handled connections. Generally, the parameter value is the same as acceptsunless some resource limits have been reached (for example, the worker_connections limit).

(4)requests-客户端连接总数
        The total number of client requests.

(5)Reading-读取请求头的当前连接数
        The current number of connections where nginx is reading the request header.

(6)Writing-将响应写回客户端的当前连接数
        The current number of connections where nginx is writing the response back to the client.

(7)Waiting-等待请求的当前空闲客户端连接数
        The current number of idle client connections waiting for a request.

参考官网地址:https://nginx.org/libxslt/en/docs/http/ngx_http_stub_status_module.html

到此这篇关于nginx 添加http_stub_status_module模块的文章就介绍到这了!


Tags in this post...

Servers 相关文章推荐
配置nginx 重定向到系统维护页面
Jun 08 Servers
Rhit高效可视化Nginx日志查看工具
Nov 01 Servers
Apache Linkis 中间件架构及快速安装步骤
Mar 16 Servers
详解使用内网穿透工具Ngrok代理本地服务
Mar 31 Servers
使用Docker容器部署rocketmq单机的全过程
Apr 03 Servers
忘记Grafana不要紧2种Grafana重置admin密码方法详细步骤
Apr 07 Servers
Windows Server 2008 修改远程登录端口以及配置防火墙
Apr 28 Servers
在Windows Server 2012上安装 .NET Framework 3.5 所遇到的问题
Apr 29 Servers
如何让你的Nginx支持分布式追踪详解
Jul 07 Servers
Docker安装MySql8并远程访问的实现
Jul 07 Servers
windows系统搭建WEB服务器详细教程
Aug 05 Servers
Flink 侧流输出源码示例解析
Sep 23 Servers
docker 制作mysql镜像并自动安装
May 20 #Servers
阿里云服务器Ubuntu 20.04上安装Odoo 15
May 20 #Servers
Apache SeaTunnel实现 非CDC数据抽取
May 20 #Servers
apache ftpserver搭建ftp服务器
May 20 #Servers
服务器间如何实现文件共享
May 20 #Servers
Nginx限流和黑名单配置
May 20 #Servers
Nginx利用Logrotate实现日志分割
May 20 #Servers
You might like
一篇不错的PHP基础学习笔记
2007/03/18 PHP
gd库图片下载类实现下载网页所有图片的php代码
2012/08/20 PHP
php_screw安装使用教程(另一个PHP代码加密实现)
2014/05/29 PHP
深入理解PHP之源码目录结构与功能说明
2016/06/01 PHP
PHP实现登陆并抓取微信列表中最新一组微信消息的方法
2017/07/10 PHP
PHP PDO和消息队列的个人理解与应用实例分析
2019/11/25 PHP
抽出www.templatemonster.com的鼠标悬停加载大图模板的代码
2007/07/11 Javascript
JavaScript面向对象设计二 构造函数模式
2011/12/20 Javascript
一个简单的jQuery插件ajaxfileupload.js实现ajax上传文件例子
2014/06/26 Javascript
使用控制台破解百小度一个月只准改一次名字
2015/08/13 Javascript
封装好的javascript前端分页插件pagination
2016/01/04 Javascript
js实现纯前端的图片预览
2016/04/27 Javascript
使用Node.js给图片加水印的方法
2016/11/15 Javascript
基于bootstrap风格的弹框插件
2016/12/28 Javascript
详解nodejs express下使用redis管理session
2017/04/24 NodeJs
vue元素实现动画过渡效果
2017/07/01 Javascript
vue 动态改变静态图片以及请求网络图片的实现方法
2018/02/07 Javascript
微信小程序WebSocket实现聊天对话功能
2018/07/06 Javascript
基于vue中的scoped坑点解说
2020/09/04 Javascript
[01:00]选手抵达华西村 整装待发备战2016国际邀请赛中国区预选赛
2016/06/25 DOTA
[40:19]完美世界DOTA2联赛PWL S3 Rebirth vs CPG 第二场 12.18
2020/12/19 DOTA
查看python下OpenCV版本的方法
2018/08/03 Python
Python实现快速排序的方法详解
2019/10/25 Python
Python利用PyExecJS库执行JS函数的案例分析
2019/12/18 Python
python with语句的原理与用法详解
2020/03/30 Python
小橄榄树:Le Petit Olivier
2018/04/23 全球购物
介绍一下mysql的日期和时间函数
2013/03/28 面试题
法律进机关实施方案
2014/03/12 职场文书
低碳环保标语
2014/06/12 职场文书
中文专业自荐书
2014/06/29 职场文书
学雷锋主题班会教案
2015/08/13 职场文书
2016寒假假期总结
2015/10/10 职场文书
古诗文之爱国名句(77句)
2019/09/24 职场文书
元素水平垂直居中的方式
2021/03/31 HTML / CSS
使用pandas或numpy处理数据中的空值(np.isnan()/pd.isnull())
2021/05/14 Python
Maven学习----Maven安装与环境变量配置教程
2021/06/29 Java/Android