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
小程序后台PHP版本部署运行 LNMP+WNMP
Apr 01 Servers
Nginx URL重写rewrite机制原理及使用实例
Apr 01 Servers
Nginx防盗链与服务优化配置的全过程
Jan 18 Servers
nginx常用配置conf的示例代码详解
Mar 21 Servers
Tomcat用户管理的优化配置详解
Mar 31 Servers
iSCSI服务器CHAP双向认证配置
Apr 01 Servers
详解如何使用Nginx解决跨域问题
May 06 Servers
利用Apache Common将java对象池化的问题
Jun 16 Servers
Nginx文件已经存在全局反向代理问题排查记录
Jul 15 Servers
Zabbix6通过ODBC方式监控Oracle 19C的详细过程
Sep 23 Servers
Elasticsearch6.2服务器升配后的bug(避坑指南)
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
xajax写的留言本
2006/11/25 PHP
生成ubuntu自动切换壁纸xml文件的php代码
2010/07/17 PHP
PHP中MVC模式的模板引擎开发经验分享
2011/03/23 PHP
php性能优化分析工具XDebug 大型网站调试工具
2011/05/22 PHP
php将字符串转化成date存入数据库的两种方式
2014/04/28 PHP
Yii2中设置与获取别名的函数(setAlias和getAlias)用法分析
2016/07/25 PHP
firefox浏览器下javascript 拖动层效果与原理分析代码
2007/12/04 Javascript
用Juery网页选项卡实现代码
2011/06/13 Javascript
js动态为代码着色显示行号
2013/05/29 Javascript
JavaScript判断密码强度(自写代码)
2013/09/06 Javascript
JS 仿腾讯发表微博的效果代码
2013/12/25 Javascript
深入理解JavaScript系列(26):设计模式之构造函数模式详解
2015/03/03 Javascript
js获取form的方法
2015/05/06 Javascript
浅谈javascript中的DOM方法
2015/07/16 Javascript
javascript使用输出语句实现网页特效代码
2015/08/06 Javascript
全屏js头像上传插件源码高清版
2016/03/29 Javascript
浅谈时钟的生成(js手写简洁代码)
2016/08/20 Javascript
详解vue-cli中模拟数据的两种方法
2018/07/03 Javascript
js中的数组对象排序分析
2018/12/11 Javascript
vue简单封装axios插件和接口的统一管理操作示例
2020/02/02 Javascript
JS+CSS实现动态时钟
2021/02/19 Javascript
[45:40]Ti4 冒泡赛第二天NEWBEE vs NaVi 1
2014/07/15 DOTA
使用wxPython获取系统剪贴板中的数据的教程
2015/05/06 Python
python实现数据导出到excel的示例--普通格式
2018/05/03 Python
详解Python3的TFTP文件传输
2018/06/26 Python
pytorch获取模型某一层参数名及参数值方式
2019/12/30 Python
vscode+PyQt5安装详解步骤
2020/08/12 Python
Python装饰器如何实现修复过程解析
2020/09/05 Python
详解python程序中的多任务
2020/09/16 Python
HTML5 Canvas中使用路径描画二阶、三阶贝塞尔曲线
2015/01/01 HTML / CSS
美国儿童运动鞋和服装零售商:Kids Foot Locker
2017/08/05 全球购物
汽车技术服务与营销专业在籍生自荐信
2013/09/28 职场文书
关于运动会的稿件
2014/02/02 职场文书
党支部意见范文
2015/06/02 职场文书
红高粱观后感
2015/06/10 职场文书
写作技巧:优秀文案必备的3种结构
2019/08/19 职场文书