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
解决Nginx 配置 proxy_pass 后 返回404问题
Mar 31 Servers
windows下快速安装nginx并配置开机自启动的方法
May 11 Servers
苹果M1芯片安装nginx 并且部署vue项目步骤详解
Nov 20 Servers
Nginx的基本概念和原理
Mar 21 Servers
Nginx 常用配置
May 15 Servers
详解Nginx的超时keeplive_timeout配置步骤
May 25 Servers
教你如何用cmd快速登录服务器
Jun 10 Servers
Nginx配置使用详解
Jul 07 Servers
Apache Kafka 分区重分配的实现原理解析
Jul 15 Servers
Nginx如何获取自定义请求header头和URL参数详解
Jul 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来自动调用不同服务器上的flash
2006/10/09 PHP
PHP 向右侧拉菜单实现代码,测试使用中
2009/11/03 PHP
解析php函数method_exists()与is_callable()的区别
2013/06/21 PHP
php中apc缓存使用示例
2013/12/25 PHP
php操作mysql数据库的基本类代码
2014/02/25 PHP
PHP中的多种加密技术及代码示例解析
2016/10/20 PHP
php生成毫秒时间戳的实例讲解
2017/09/22 PHP
Javascript 作用域使用说明
2009/08/13 Javascript
jquery获得keycode的示例代码
2013/12/30 Javascript
基于JQuery实现滚动到页面底端时自动加载更多信息
2014/01/31 Javascript
js中hash和ico的关联分析
2015/02/05 Javascript
JavaScript常用脚本汇总(一)
2015/03/04 Javascript
js完美实现@提到好友特效(兼容各大浏览器)
2015/03/16 Javascript
JavaScript中消除闭包的一般方法介绍
2015/03/16 Javascript
JS+CSS实现TreeMenu二级树形菜单完整实例
2015/09/18 Javascript
轻松学习Javascript闭包函数
2015/12/15 Javascript
全面理解JavaScript中的闭包
2016/05/12 Javascript
JavaScript性能优化之函数节流(throttle)与函数去抖(debounce)
2016/08/11 Javascript
微信小程序 实战小程序实例
2016/10/08 Javascript
使用InstantClick.js让页面提前加载200ms
2017/09/12 Javascript
vue实现通讯录功能
2018/07/14 Javascript
vue router带参数页面刷新或回退参数消失的解决方法
2019/02/27 Javascript
详解vue 在移动端体验上的优化解决方案
2019/05/20 Javascript
基于vue.js实现购物车
2020/01/15 Javascript
JS实现百度搜索框关键字推荐
2020/02/17 Javascript
Python显示进度条的方法
2014/09/20 Python
快速了解Python开发中的cookie及简单代码示例
2018/01/17 Python
详解android与HTML混合开发总结
2018/06/06 HTML / CSS
*p++ 自增p 还是p所指向的变量
2016/07/16 面试题
群众路线剖析材料
2014/02/02 职场文书
新年团拜会主持词
2014/04/02 职场文书
超市开业庆典活动策划方案
2014/09/15 职场文书
2015年公司工作总结
2015/04/25 职场文书
react 项目中引入图片的几种方式
2021/06/02 Javascript
Python时间操作之pytz模块使用详解
2022/06/14 Python
关于对TypeScript泛型参数的默认值理解
2022/07/15 Javascript