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实现发布静态资源的方法
Mar 31 Servers
Nginx tp3.2.3 404问题解决方案
Mar 31 Servers
详解nginx.conf 中 root 目录设置问题
Apr 01 Servers
Nginx的基本概念和原理
Mar 21 Servers
Nginx反向代理、重定向
Apr 13 Servers
Linux中如何安装并部署Redis
Apr 18 Servers
Nginx的gzip相关介绍
May 11 Servers
Nginx 匹配方式
May 15 Servers
git中cherry-pick命令的使用教程
Jun 25 Servers
使用 DataAnt 监控 Apache APISIX的原理解析
Jul 07 Servers
阿里云服务器(windows)手动部署FTP站点详细教程
Aug 05 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
YII2框架中excel表格导出的方法详解
2017/07/21 PHP
javascript StringBuilder类实现
2008/12/22 Javascript
Mootools 1.2教程 事件处理
2009/09/15 Javascript
js获取浏览器的可视区域尺寸的实现代码
2011/11/30 Javascript
js 获取时间间隔实现代码
2014/05/12 Javascript
两种方法基于jQuery实现IE浏览器兼容placeholder效果
2014/10/14 Javascript
jQuery中:file选择器用法实例
2015/01/04 Javascript
js+css实现tab菜单切换效果的方法
2015/01/20 Javascript
JS实现同时搜索百度和必应的方法
2015/01/27 Javascript
JavaScript中的slice()方法使用详解
2015/06/06 Javascript
js实现适用于素材网站的黑色多级菜单导航条效果
2015/08/24 Javascript
14款经典网页图片和文字特效的jQuery插件-前端开发必备
2015/08/25 Javascript
文件上传,iframe跨域数据提交的实现
2016/11/18 Javascript
原生js轮播(仿慕课网)
2017/02/15 Javascript
Angular+Bootstrap+Spring Boot实现分页功能实例代码
2017/07/21 Javascript
详解JavaScript的变量
2019/04/04 Javascript
JS插件amCharts实现绘制柱形图默认显示数值功能示例
2019/11/26 Javascript
vue+elementUI中表格高亮或字体颜色改变操作
2020/11/02 Javascript
深入讲解Python中面向对象编程的相关知识
2015/05/25 Python
Python编程之event对象的用法实例分析
2017/03/23 Python
Python安装官方whl包和tar.gz包的方法(推荐)
2017/06/04 Python
python实现用户管理系统
2018/01/10 Python
python一行sql太长折成多行并且有多个参数的方法
2018/07/19 Python
详解pandas如何去掉、过滤数据集中的某些值或者某些行?
2019/05/15 Python
xadmin使用formfield_for_dbfield函数过滤下拉表单实例
2020/04/07 Python
python GUI模拟实现计算器
2020/06/22 Python
互斥锁解决 Python 中多线程共享全局变量的问题(推荐)
2020/09/28 Python
利用HTML5 Canvas API绘制矩形的超级攻略
2016/03/21 HTML / CSS
html5实现输入框fixed定位在屏幕最底部兼容性
2020/07/03 HTML / CSS
德国家具在线:Fashion For Home
2017/03/11 全球购物
Stio官网:男女、儿童户外服装
2019/12/13 全球购物
M.M.LaFleur官网:美国职业女装品牌
2020/10/27 全球购物
生物制药专业求职信
2014/03/11 职场文书
出售房屋协议书范本
2014/10/06 职场文书
2014年护士工作总结范文
2014/11/11 职场文书
2015秋季开学典礼演讲稿
2015/07/16 职场文书