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 stream 配置代理(Nginx TCP/UDP 负载均衡)
Nov 17 Servers
Dashboard管理Kubernetes集群与API访问配置
Apr 01 Servers
CentOS下安装Jenkins的完整步骤
Apr 07 Servers
Docker下安装Oracle19c
Apr 13 Servers
Windows Server 2012 R2 磁盘分区教程
Apr 29 Servers
nginx实现多geoserver服务的负载均衡
May 15 Servers
netty 实现tomcat的示例代码
Jun 05 Servers
windows server 2012安装FTP并配置被动模式指定开放端口
Jun 10 Servers
vscode远程免密登入Linux服务器的配置方法
Jun 28 Servers
django项目、vue项目部署云服务器的详细过程
Jul 23 Servers
教你使用Ubuntu搭建DNS服务器
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 laravel中的多对多关系实例详解
2017/06/07 PHP
Laravel中七个非常有用但很少人知道的Carbon方法
2017/09/21 PHP
jQuery中的.bind()、.live()和.delegate()之间区别分析
2011/06/08 Javascript
event.X和event.clientX的区别分析
2011/10/06 Javascript
JavaScript对数字的判断与处理实例分析
2015/02/02 Javascript
JS显示下拉列表框内全部元素的方法
2015/03/31 Javascript
Javascript获取表单名称(name)的方法
2015/04/02 Javascript
JS中setTimeout的巧妙用法前端函数节流
2016/03/24 Javascript
iScroll.js 使用方法参考
2016/05/16 Javascript
AngularJS中的指令全面解析(必看)
2016/05/20 Javascript
Angular实现购物车计算示例代码
2017/02/21 Javascript
老生常谈jquery中detach()和remove()的区别
2017/03/02 Javascript
基于React实现表单数据的添加和删除详解
2017/03/14 Javascript
Vue计算属性的学习笔记
2017/03/22 Javascript
js 毫秒转天时分秒的实例
2017/11/17 Javascript
vue移动端实现下拉刷新
2018/04/22 Javascript
原生JS forEach()和map()遍历的区别、兼容写法及jQuery $.each、$.map遍历操作
2019/02/27 jQuery
axios实现简单文件上传功能
2019/09/25 Javascript
Vue实现省市区三级联动
2020/12/27 Vue.js
[47:55]Ti4第二日主赛事败者组 NaVi vs EG 1
2014/07/20 DOTA
Python2.x中str与unicode相关问题的解决方法
2015/03/30 Python
利用Python爬取可用的代理IP
2016/08/18 Python
python使用pymysql实现操作mysql
2016/09/13 Python
解决Mac安装scrapy失败的问题
2018/06/13 Python
python使用自定义钉钉机器人的示例代码
2020/06/24 Python
白兰氏健康Mall:BRAND’S
2017/11/13 全球购物
经济实惠的豪华家具:My-Furniture
2019/03/12 全球购物
SQL Server笔试题
2012/01/10 面试题
军训自我鉴定
2013/12/14 职场文书
机关单位人员学雷锋心得体会
2014/03/10 职场文书
区域销售主管岗位职责
2014/06/15 职场文书
小学生清明节演讲稿
2014/09/05 职场文书
中国在我心中演讲稿
2014/09/13 职场文书
PyTorch的Debug指南
2021/05/07 Python
斗罗大陆八大特殊魂兽,龙族始祖排榜首,第五最残忍(翠魔鸟)
2022/03/18 国漫
用Python仅20行代码编写一个简单的端口扫描器
2022/04/08 Python