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如何将http访问的网站改成https访问
Mar 31 Servers
Nginx开启Brotli压缩算法实现过程详解
Mar 31 Servers
nginx部署多前端项目的几种方法
May 25 Servers
配置nginx 重定向到系统维护页面
Jun 08 Servers
centos8安装nginx1.9.1的详细过程
Aug 02 Servers
教你快速构建一个基于nginx的web集群项目
Nov 27 Servers
Kubernetes部署实例并配置Deployment、网络映射、副本集
Apr 01 Servers
docker-compose部署Yapi的方法
Apr 08 Servers
如何Tomcat中使用ipv6地址
May 06 Servers
Nginx报404错误的详细解决方法
Jul 23 Servers
Apache SkyWalking 监控 MySQL Server 实战解析
Sep 23 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实现网站插件机制的方法
2009/11/10 PHP
jQuery EasyUI API 中文文档 - DateBox日期框
2011/10/15 PHP
优化PHP程序的方法小结
2012/02/23 PHP
PHP对表单提交特殊字符的过滤和处理方法汇总
2014/02/18 PHP
PHP正则验证Email的方法
2015/06/15 PHP
再谈Yii Framework框架中的事件event原理与应用
2020/04/07 PHP
用正则获取指定路径文件的名称
2007/02/27 Javascript
jQuery源码分析之Event事件分析
2010/06/07 Javascript
jquery EasyUI的formatter格式化函数代码
2011/01/12 Javascript
Jquery chosen动态设置值实例介绍
2013/08/08 Javascript
JavaScript 动态加载脚本和样式的方法
2015/04/13 Javascript
JS实现仿微博可关闭弹出层效果
2015/09/21 Javascript
jQuery实现下拉框功能实例代码
2016/05/06 Javascript
ng2学习笔记之bootstrap中的component使用教程
2017/03/09 Javascript
jquery easyui如何实现格式化列
2017/07/30 jQuery
js实现全选反选不选功能代码详解
2019/04/24 Javascript
vue路由拦截器和请求拦截器知识点总结
2019/11/08 Javascript
微信小程序实现点击导航标签滚动定位到对应位置
2020/11/19 Javascript
[01:35]2018完美盛典章节片——共竞
2018/12/17 DOTA
python爬虫入门教程之糗百图片爬虫代码分享
2014/09/02 Python
Python获取服务器信息的最简单实现方法
2015/03/05 Python
解决Django数据库makemigrations有变化但是migrate时未变动问题
2018/05/30 Python
pycharm远程开发项目的实现步骤
2019/01/20 Python
学生如何注册Pycharm专业版以及pycharm的安装
2020/09/24 Python
HTML5 WebGL 实现民航客机飞行监控系统
2019/07/25 HTML / CSS
HTML5页面中尝试调起APP功能
2017/09/12 HTML / CSS
免税水晶:Duty Free Crystal
2019/05/13 全球购物
"序列点" 是什么
2016/07/29 面试题
小学教师管理制度
2014/01/18 职场文书
教代会闭幕词
2015/01/28 职场文书
2015年信访维稳工作总结
2015/04/07 职场文书
2015年学校党建工作总结
2015/05/19 职场文书
班主任经验交流心得体会
2015/11/02 职场文书
2016元旦主持人开场白
2015/12/03 职场文书
php7中停止php-fpm服务的方法详解
2021/05/09 PHP
Github 使用python对copilot做些简单使用测试
2022/04/14 Python