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 比 Apache 更牛逼
Mar 31 Servers
Linux安装Nginx步骤详解
Mar 31 Servers
nginx简单配置多个server的方法
Mar 31 Servers
nginx部署多前端项目的几种方法
May 25 Servers
Nginx部署vue项目和配置代理的问题解析
Aug 04 Servers
使用Nginx搭载rtmp直播服务器的方法
Oct 16 Servers
图文详解nginx日志切割的实现
Jan 18 Servers
Apache Hudi数据布局黑科技降低一半查询时间
Mar 31 Servers
深入解析Apache Hudi内核文件标记机制
Mar 31 Servers
使用Docker容器部署rocketmq单机的全过程
Apr 03 Servers
HDFS免重启挂载新磁盘
Apr 06 Servers
Nginx 配置 HTTPS的详细过程
May 30 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版(1)
2006/10/09 PHP
ThinkPHP3.1新特性之对Ajax的支持更加完善
2014/06/19 PHP
php生成xml时添加CDATA标签的方法
2014/10/17 PHP
php similar_text()函数的定义和用法
2016/05/12 PHP
PHP模糊查询技术实例分析【附源码下载】
2019/03/07 PHP
JavaScript使用过程中需要注意的地方和一些基本语法
2010/08/26 Javascript
js confirm()方法的使用方法实例
2013/07/13 Javascript
JQuery插件jcarousellite的参数中文说明
2015/05/11 Javascript
jquery分析文本里url或邮件地址为真实链接的方法
2015/06/20 Javascript
js点击列表文字对应该行显示背景颜色的实现代码
2015/08/05 Javascript
jquery根据td给相同tr下其他td赋值的实现方法
2016/10/05 Javascript
js与jquery分别实现tab标签页功能的方法
2016/11/18 Javascript
详解JavaScript中this的指向问题
2017/01/20 Javascript
JS查找英文文章中出现频率最高的单词
2017/03/20 Javascript
easyUI 实现的后台分页与前台显示功能示例
2020/06/01 Javascript
Flask框架学习笔记(一)安装篇(windows安装与centos安装)
2014/06/25 Python
Flask入门教程实例:搭建一个静态博客
2015/03/27 Python
python 堆和优先队列的使用详解
2019/03/05 Python
numpy数组广播的机制
2019/07/12 Python
tensorflow如何批量读取图片
2019/08/29 Python
python GUI库图形界面开发之PyQt5下拉列表框控件QComboBox详细使用方法与实例
2020/02/27 Python
Python运行提示缺少模块问题解决方案
2020/04/02 Python
Python爬虫回测股票的实例讲解
2021/01/22 Python
Crocs美国官方网站:卡骆驰洞洞鞋
2017/08/04 全球购物
澳大利亚女士时装在线:Rockmans
2018/09/26 全球购物
Nike比利时官网:Nike.com (BE)
2019/02/07 全球购物
美国在线鞋类零售商:LifeStride
2019/06/09 全球购物
Java语言的优势
2015/01/10 面试题
优秀辅导员事迹材料
2014/02/16 职场文书
《掌声》教学反思
2014/02/23 职场文书
忠犬八公的故事观后感
2015/06/05 职场文书
罗马假日观后感
2015/06/08 职场文书
如何撰写出一份完美的商业计划书?
2019/07/12 职场文书
Go语言-为什么返回值为接口类型,却返回结构体
2021/04/24 Golang
基于JavaScript实现年月日三级联动
2021/06/22 Javascript
python之PySide2安装使用及QT Designer UI设计案例教程
2021/07/26 Python