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基于域名,端口,不同IP的虚拟主机设置的实现
Mar 31 Servers
详解Nginx 工作原理
Mar 31 Servers
Nginx使用X-Accel-Redirect实现静态文件下载的统计、鉴权、防盗链、限速等
Apr 04 Servers
使用 Apache 反向代理的设置技巧
Jan 18 Servers
nginx共享内存的机制详解
Mar 21 Servers
Nginx流量拷贝ngx_http_mirror_module模块使用方法详解
Apr 07 Servers
centos7安装mysql5.7经验记录
May 02 Servers
Windows Server 2008配置防火墙策略详解
Jun 28 Servers
使用 DataAnt 监控 Apache APISIX的原理解析
Jul 07 Servers
Nginx配置使用详解
Jul 07 Servers
Win10系统搭建ftp文件服务器详细教程
Aug 05 Servers
Fluentd搭建日志收集服务
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
全国FM电台频率大全 - 24 贵州省
2020/03/11 无线电
开启CURL扩展,让服务器支持PHP curl函数(远程采集)
2011/03/19 PHP
使用php实现快钱支付功能(涉及到接口)
2013/07/01 PHP
如何在HTML 中嵌入 PHP 代码
2015/05/13 PHP
微信公众号实现扫码获取微信用户信息(网页授权)
2019/04/09 PHP
js中获取事件对象的方法小结
2011/03/13 Javascript
javascript学习笔记(三) String 字符串类型介绍
2012/06/19 Javascript
JavaScript事件处理器中的event参数使用介绍
2013/05/24 Javascript
关于Javascript作用域链的八点总结
2013/12/06 Javascript
分享一则javascript 调试技巧
2015/01/02 Javascript
nodejs简单实现操作arduino
2016/09/25 NodeJs
JavaScript获取服务器端时间的方法
2016/11/29 Javascript
微信小程序 PHP后端form表单提交实例详解
2017/01/12 Javascript
原生JS实现九宫格抽奖效果
2017/04/01 Javascript
ReactNative短信验证码倒计时控件的实现代码
2017/07/20 Javascript
Vue+Webpack完美整合富文本编辑器TinyMce的方法
2018/11/30 Javascript
Vue使用lodop实现打印小结
2019/07/06 Javascript
全局安装 Vue cli3 和 继续使用 Vue-cli2.x操作
2020/09/08 Javascript
[04:48]DOTA2亚洲邀请赛林书豪为VGJ加油
2017/04/01 DOTA
python实现探测socket和web服务示例
2014/03/28 Python
Python中装饰器的一个妙用
2015/02/08 Python
在Python的Flask框架中构建Web表单的教程
2016/06/04 Python
python使用fork实现守护进程的方法
2017/11/16 Python
Python shelve模块实现解析
2019/08/28 Python
Python如何实现强制数据类型转换
2019/11/22 Python
python3.6.8 + pycharm + PyQt5 环境搭建的图文教程
2020/06/11 Python
什么是Python包的循环导入
2020/09/08 Python
Scrapy-Redis之RedisSpider与RedisCrawlSpider详解
2020/11/18 Python
python 通过exifread读取照片信息
2020/12/24 Python
关于教师节的广播稿
2014/09/10 职场文书
2015年入党积极分子评语
2015/03/26 职场文书
卫生院义诊活动总结
2015/05/07 职场文书
感谢师恩主题班会
2015/08/17 职场文书
2016年教师新年寄语
2015/08/18 职场文书
担保书怎么写 ?
2019/04/22 职场文书
公司财务制度:成本管理控制制度模板
2019/11/19 职场文书