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 相关文章推荐
使用 Apache 反向代理的设置技巧
Jan 18 Servers
使用 Apache Dubbo 实现远程通信(微服务架构)
Feb 12 Servers
Nginx性能优化之Gzip压缩设置详解(最大程度提高页面打开速度)
Feb 12 Servers
nginx配置之并发频次限制
Apr 18 Servers
Tomcat starup.bat 脚本实现开机自启动
Apr 20 Servers
Win10 Anaconda安装python-pcl
Apr 29 Servers
Nginx静态压缩和代码压缩提高访问速度详解
May 30 Servers
讨论nginx location 顺序问题
May 30 Servers
windows server 2012安装FTP并配置被动模式指定开放端口
Jun 10 Servers
Nginx如何配置根据路径转发详解
Jul 23 Servers
Nginx报错104:Connection reset by peer问题的解决及分析
Jul 23 Servers
win10搭建配置ftp服务器的方法
Aug 05 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学习之数组值的操作
2011/04/17 PHP
PHP5.4中json_encode中文转码的变化小结
2013/01/30 PHP
PHP程序漏洞产生的原因分析与防范方法说明
2014/03/06 PHP
宝塔面板在NGINX环境中TP5.1如何运行?
2021/03/09 PHP
javascript中的location用法简单介绍
2007/03/07 Javascript
script标签的 charset 属性使用说明
2010/12/04 Javascript
使用jQuery.fn自定义jQuery翻页插件
2013/01/20 Javascript
从数组中随机取x条不重复数据的JS代码
2013/12/24 Javascript
node.js中的fs.fchmod方法使用说明
2014/12/16 Javascript
jquery图形密码实现方法
2015/03/11 Javascript
JavaScript通过setTimeout实时显示当前时间的方法
2015/04/16 Javascript
jQuery实现带玻璃流光质感的手风琴特效
2015/11/20 Javascript
Jquery 1.9.1源码分析系列(十二)之筛选操作
2015/12/02 Javascript
详解AngularJS控制器的使用
2016/03/09 Javascript
JavaScript 2048 游戏实例代码(简单易懂)
2016/03/25 Javascript
Javascript中内建函数reduce的应用详解
2016/10/20 Javascript
JS实现的模仿QQ头像资料卡显示与隐藏效果
2017/04/07 Javascript
ES6中Array.includes()函数的用法
2017/09/20 Javascript
微信小程序实现倒计时补零功能
2018/07/09 Javascript
jQuery.validate.js表单验证插件的使用代码详解
2018/10/22 jQuery
在vue项目中使用codemirror插件实现代码编辑器功能
2019/08/27 Javascript
js利用递归与promise 按顺序请求数据的方法
2019/08/30 Javascript
Python通过select实现异步IO的方法
2015/06/04 Python
Python使用内置json模块解析json格式数据的方法
2017/07/20 Python
学习Python3 Dlib19.7进行人脸面部识别
2018/01/24 Python
pandas条件组合筛选和按范围筛选的示例代码
2019/08/26 Python
在django-xadmin中APScheduler的启动初始化实例
2019/11/15 Python
解决Tensorflow 内存泄露问题
2020/02/05 Python
python中字符串的编码与解码详析
2020/12/03 Python
css背景图片的背景裁切、背景透明度、背景变换等效果运用
2012/12/24 HTML / CSS
浅谈CSS3特性查询(Feature Query: @supports)功能简介
2017/07/31 HTML / CSS
美国最好的葡萄酒网上商店:Wine Library
2019/11/02 全球购物
这段代码难道不该打印出56吗
2013/02/27 面试题
七年级生物教学反思
2014/01/30 职场文书
酒店总经理岗位职责
2015/04/01 职场文书
初三英语教学反思
2016/02/15 职场文书