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如何配置Http、Https、WS、WSS的方法步骤
May 11 Servers
nginx内存池源码解析
Nov 20 Servers
Window server 2012 R2 AD域的组策略相关设置
Apr 28 Servers
docker compose 部署 golang 的 Athens 私有代理问题
Apr 28 Servers
Win10 Anaconda安装python-pcl
Apr 29 Servers
nginx实现多geoserver服务的负载均衡
May 15 Servers
Win2008系统搭建DHCP服务器
Jun 25 Servers
设置IIS Express并发数
Jul 07 Servers
Nginx文件已经存在全局反向代理问题排查记录
Jul 15 Servers
教你使用Ubuntu搭建DNS服务器
Sep 23 Servers
ubuntu开机后ROS程序自启动问题
Dec 24 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
Netflix将与CLAMP、乙一以及冲方丁等6名知名制作人合伙展开原创动画计划!
2020/03/06 日漫
德生PL990,目前市面上唯一一款便携式插卡蓝牙全波段高性能收音机
2021/03/02 无线电
Breeze 文章管理系统 v1.0.0正式发布
2006/12/14 PHP
php在页面中调用fckeditor编辑器的方法
2011/06/10 PHP
PHP如何解决网站大流量与高并发的问题
2011/06/25 PHP
phpcms模块开发之swfupload的使用介绍
2013/04/28 PHP
叫你如何修改Nginx与PHP的文件上传大小限制
2014/09/10 PHP
PHP使用json_encode函数时不转义中文的解决方法
2014/11/12 PHP
thinkphp如何获取客户端IP
2015/11/03 PHP
php注册系统和使用Xajax即时验证用户名是否被占用
2017/08/31 PHP
Laravel5.1 框架Request请求操作常见用法实例分析
2020/01/04 PHP
javascript让setInteval里的函数参数中的this指向特定的对象
2010/01/31 Javascript
javascript中万恶的function实例分析
2011/05/25 Javascript
JS截取url中问号后面参数的值信息
2014/04/29 Javascript
jQuery 实现自动填充邮箱功能(带下拉提示)
2014/10/14 Javascript
轻松实现js图片预览功能
2016/01/18 Javascript
Bootstrap滚动监听(Scrollspy)插件详解
2016/04/26 Javascript
javascript 分号总结及详细介绍
2016/09/24 Javascript
nodejs个人博客开发第七步 后台登陆
2017/04/12 NodeJs
layui添加动态菜单与选项卡 AJAX请求的例子
2019/09/25 Javascript
微信小程序学习总结(四)事件与冒泡实例分析
2020/06/04 Javascript
[01:03]悬念揭晓 11月26日DOTA2完美盛典不见不散
2017/11/23 DOTA
Mac下Supervisor进程监控管理工具的安装与配置
2014/12/16 Python
仅利用30行Python代码来展示X算法
2015/04/01 Python
Python检测字符串中是否包含某字符集合中的字符
2015/05/21 Python
Python生成器generator用法示例
2018/08/10 Python
Python进阶之全面解读高级特性之切片
2019/02/19 Python
对python中GUI,Label和Button的实例详解
2019/06/27 Python
对Python _取log的几种方式小结
2019/07/25 Python
pandas-resample按时间聚合实例
2019/12/27 Python
Python如何脚本过滤文件中的注释
2020/05/27 Python
TripAdvisor瑞典:全球领先的旅游网站
2017/12/11 全球购物
程序集与命名空间有什么不同
2014/07/25 面试题
技术总监管理岗位职责
2014/03/09 职场文书
高考1977观后感
2015/06/04 职场文书
PHP中多字节字符串操作实例详解
2021/08/23 PHP