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 相关文章推荐
Linux安装Nginx步骤详解
Mar 31 Servers
Shell脚本一键安装Nginx服务自定义Nginx版本
Mar 20 Servers
Nginx设置HTTPS的方法步骤 443证书配置方法
Mar 21 Servers
Nginx禁止ip访问或非法域名访问
Apr 07 Servers
Docker官方工具docker-registry案例演示
Apr 13 Servers
Nginx 常用配置
May 15 Servers
WinServer2012搭建DNS服务器的方法步骤
Jun 10 Servers
安装harbor作为docker镜像仓库的问题
Jun 14 Servers
利用Apache Common将java对象池化的问题
Jun 16 Servers
Windows Server 修改远程桌面端口的实现
Jun 25 Servers
设置IIS Express并发数
Jul 07 Servers
Apache Kafka 分区重分配的实现原理解析
Jul 15 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判断手机访问还是电脑访问示例分享
2014/01/20 PHP
Codeigniter中禁止A Database Error Occurred错误提示的方法
2014/06/12 PHP
php使用ob_start()实现图片存入变量的方法
2014/11/14 PHP
根据分辨率不同,调用不同的css文件
2006/07/07 Javascript
浅析IE10兼容性问题(frameset的cols属性)
2014/01/03 Javascript
javascript中CheckBox全选终极方案
2015/05/20 Javascript
jQuery中的ajax async同步和异步详解
2015/09/29 Javascript
JavaScript的Number对象的toString()方法
2015/12/18 Javascript
javascript ASCII和Hex互转的实现方法
2016/12/27 Javascript
nodejs处理图片的中间件node-images详解
2017/05/08 NodeJs
详解vue.js之绑定class和style的示例代码
2017/08/24 Javascript
react router 4.0以上的路由应用详解
2017/09/21 Javascript
基于angular6.0实现的一个组件懒加载功能示例
2018/04/12 Javascript
纯JS实现可用于页码更换的飞页特效示例
2018/05/21 Javascript
vue脚手架搭建过程图解
2018/06/06 Javascript
vue实现购物车加减
2020/05/30 Javascript
python Flask 装饰器顺序问题解决
2018/08/08 Python
Pandas 重塑(stack)和轴向旋转(pivot)的实现
2019/07/22 Python
Pytorch 实现数据集自定义读取
2020/01/18 Python
使用tensorflow显示pb模型的所有网络结点方式
2020/01/23 Python
Python sys模块常用方法解析
2020/02/20 Python
Python中的xlrd模块使用原理解析
2020/05/21 Python
python中有帮助函数吗
2020/06/19 Python
基于python requests selenium爬取excel vba过程解析
2020/08/12 Python
pycharm 多行批量缩进和反向缩进快捷键介绍
2021/01/15 Python
J.Crew官网:美国知名休闲服装品牌
2017/05/19 全球购物
IWOOT美国:新奇的小玩意
2018/04/27 全球购物
Lacoste(法国鳄鱼)加拿大官网:以标志性的POLO衫而闻名
2019/05/15 全球购物
美国购买舞会礼服网站:Couture Candy
2019/12/29 全球购物
共筑中国梦演讲稿
2014/04/23 职场文书
单位员工收入证明样本
2014/10/09 职场文书
业务内勤岗位职责
2015/04/13 职场文书
企业法人代表证明书
2015/06/18 职场文书
房屋所有权证明
2015/06/19 职场文书
学校2016年九九重阳节活动总结
2016/04/01 职场文书
Python机器学习实战之k-近邻算法的实现
2021/11/27 Python