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实现限制某IP短时间访问次数
Mar 31 Servers
Nginx代理同域名前后端分离项目的完整步骤
Mar 31 Servers
Nginx已编译的nginx-添加新模块
Apr 01 Servers
解决使用了nginx获取IP地址都是127.0.0.1 的问题
Sep 25 Servers
详解Nginx 被动检查服务器的存活状态
Oct 16 Servers
Minikube搭建Kubernetes集群
Mar 31 Servers
iSCSI服务器CHAP双向认证配置
Apr 01 Servers
Windows Server 2008 修改远程登录端口以及配置防火墙
Apr 28 Servers
使用Apache Camel表达REST服务的方法
Jun 10 Servers
WinServer2012搭建DNS服务器的方法步骤
Jun 10 Servers
Apache Kafka 分区重分配的实现原理解析
Jul 15 Servers
keepalived + nginx 实现高可用方案
Dec 24 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文件上传(实例)
2013/10/27 PHP
让ThinkPHP支持大小写url地址访问的方法
2014/10/31 PHP
php获取文件名称和扩展名的方法
2017/02/07 PHP
php检测mysql表是否存在的方法小结
2017/07/20 PHP
JS 拼图游戏 面向对象,注释完整。
2009/06/18 Javascript
Javascript delete 引用类型对象
2013/11/01 Javascript
JS小功能(onmouseover实现选择月份)实例代码
2013/11/28 Javascript
判断复选框是否被选中的两种方法
2014/06/04 Javascript
jQuery 删除或是清空某个HTML元素示例
2014/08/04 Javascript
jQuery中$.get、$.post、$.getJSON和$.ajax的用法详解
2014/11/19 Javascript
PHP守护进程实例
2015/03/06 Javascript
JS及JQuery对Html内容编码,Html转义
2017/02/17 Javascript
Angular 4依赖注入学习教程之FactoryProvider配置依赖对象(五)
2017/06/04 Javascript
JS原型继承四步曲及原型继承图一览
2017/11/28 Javascript
对angular2中的ngfor和ngif指令嵌套实例讲解
2018/09/12 Javascript
JavaScript 实现自己的安卓手机自动化工具脚本(推荐)
2020/05/13 Javascript
[43:57]LGD vs Mineski 2018国际邀请赛小组赛BO2 第二场 8.19
2018/08/21 DOTA
Python读取mp3中ID3信息的方法
2015/03/05 Python
Python基于sftp及rsa密匙实现远程拷贝文件的方法
2016/09/21 Python
python网络爬虫之如何伪装逃过反爬虫程序的方法
2017/11/23 Python
利用numpy实现一、二维数组的拼接简单代码示例
2017/12/15 Python
python使用PIL给图片添加文字生成海报示例
2018/08/17 Python
python实现自动解数独小程序
2019/01/21 Python
Python中dict和set的用法讲解
2019/03/28 Python
Python封装成可带参数的EXE安装包实例
2019/08/24 Python
wxPython多个窗口的基本结构
2019/11/19 Python
Python实例教程之检索输出月份日历表
2020/12/16 Python
图库照片、免版税图片、矢量艺术、视频片段:Depositphotos
2019/08/02 全球购物
工商管理专业学生的自我评价
2013/10/01 职场文书
中英文自我评价常用句型
2013/12/19 职场文书
大龄毕业生求职别忘职业规划
2014/03/11 职场文书
毕业自我鉴定怎么写
2014/03/25 职场文书
2014年乡镇领导个人整改措施
2014/09/19 职场文书
12.4全国法制宣传日活动总结
2014/11/01 职场文书
亮剑精神观后感
2015/06/05 职场文书
2017元旦晚会开幕词
2016/03/03 职场文书