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 多个location转发任意请求或访问静态资源文件的实现
Mar 31 Servers
nginx安装以及配置的详细过程记录
Sep 15 Servers
Nginx stream 配置代理(Nginx TCP/UDP 负载均衡)
Nov 17 Servers
详解nginx安装过程并代理下载服务器文件
Feb 12 Servers
Nginx设置HTTPS的方法步骤 443证书配置方法
Mar 21 Servers
Dashboard管理Kubernetes集群与API访问配置
Apr 01 Servers
为Centos安装指定版本的Docker
Apr 01 Servers
永中文档在线转换预览基于nginx配置部署方案
Jun 10 Servers
使用 DataAnt 监控 Apache APISIX的原理解析
Jul 07 Servers
Shell中的单中括号和双中括号的用法详解
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+js实现的无刷新下载文件功能示例
2019/08/23 PHP
jquery插件开发注意事项小结
2013/06/04 Javascript
Ajax提交与传统表单提交的区别说明
2014/02/07 Javascript
jquery实现鼠标经过显示下划线的渐变下拉菜单效果代码
2015/08/24 Javascript
Bootstrap实现响应式导航栏效果
2015/12/28 Javascript
TypeOf这些知识点你了解吗
2016/02/21 Javascript
jQuery.datatables.js插件用法及api实例详解
2016/10/28 Javascript
基于JS组件实现拖动滑块验证功能(代码分享)
2016/11/18 Javascript
JavaScript 基础表单验证示例(纯Js实现)
2017/07/20 Javascript
Vue 实现树形视图数据功能
2018/05/07 Javascript
Nodejs中的JWT和Session的使用
2018/08/21 NodeJs
微信小程序授权登录及解密unionId出错的方法
2018/09/26 Javascript
[01:04:05]Mineski vs TNC 2019国际邀请赛小组赛 BO2 第一场 8.15
2019/08/16 DOTA
python获取文件后缀名及批量更新目录下文件后缀名的方法
2014/11/11 Python
Python标准库内置函数complex介绍
2014/11/25 Python
将Python代码打包为jar软件的简单方法
2015/08/04 Python
Python字符串拼接六种方法介绍
2017/12/18 Python
Python实现KNN邻近算法
2021/01/28 Python
python 删除非空文件夹的实例
2018/04/26 Python
python 获取当天凌晨零点的时间戳方法
2018/05/22 Python
python opencv实现切变换 不裁减图片
2018/07/26 Python
Python调用adb命令实现对多台设备同时进行reboot的方法
2018/10/15 Python
Python猜数字算法题详解
2020/03/01 Python
css3 利用transform打造走动的2D时钟
2020/10/20 HTML / CSS
使用html5 canvas绘制圆环动效
2019/06/03 HTML / CSS
如何在Canvas上的图形/图像绑定事件监听的实现
2020/09/16 HTML / CSS
linux面试题参考答案(4)
2013/01/28 面试题
机电专业大学生职业规划书范文
2014/02/25 职场文书
工程质量承诺书
2014/03/27 职场文书
2014年法院工作总结
2014/11/24 职场文书
通知的格式范文
2015/04/27 职场文书
入党积极分子培养人意见
2015/06/02 职场文书
教师网络培训心得体会
2016/01/09 职场文书
英语教学课后反思
2016/02/15 职场文书
MySQL数据库索引的最左匹配原则
2021/11/20 MySQL
Zabbix6通过ODBC方式监控Oracle 19C的详细过程
2022/09/23 Servers