nginx 添加http_stub_status_module模块
目录
- 1. stub_status 作用说明
- 2.查看现有 nginx 编译参数
- 3.使用参数重新配置configure,在原有基础上添加上 --with-http_stub_status_module
- 4.将原来的 nginx 文件备份
- 5. 编译
- 6. 替换nginx二进制文件
- 7.重新启动nginx,查看编译参数
- 8. 参考官网
- 8.1 修改配置文件
- 8.2 浏览器访问
1. stub_status 作用说明
| 编译选项 | 作用 |
|---|---|
| –with-http_stub_status_module | Nginx的客户端状态 |
2.查看现有 nginx 编译参数
./nginx -V # 如果没有我们需要的模块,例如本次试验添加的 –with-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/

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

# 在文件中添加新的 location
location /nginx_status {
stub_status;
}
# 解释说明:
nginx_status 这是自定义命名的,访问的时候添加这个字段访问
stub_status; 这个是固定参数

8.2 浏览器访问
http://192.168.169.131/nginx_status # 访问内容结果如下图

# 解释说明:
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
栏 目:其它服务器
下一篇:基于云服务MRS构建DolphinScheduler2调度系统
本文标题:nginx 添加http_stub_status_module模块
本文地址:https://zz.feitang.co/server/32916.html
您可能感兴趣的文章
- 12-22nginx代理实现静态资源访问的示例代码
- 12-22Docker 存储管理的几种方式
- 12-22nginx静态资源的服务器配置方法
- 12-22Docker Compose部署微服务项目上线功能
- 12-22GPU服务器的多用户配置方法
- 12-22docker-compose搭建etcd集群的实现(三节点)
- 12-22docker中mysql开启日志的实现步骤
- 12-22Linux下docker安装mysql8并配置远程连接
- 12-22docker部署mysql8并设置可远程连接
- 12-22阿里云oss对象存储使用详细步骤


阅读排行
推荐教程
- 12-11docker存储目录迁移示例教程
- 12-10docker start启动容器后仍然exit状态的解决
- 12-10Linux下如何安装Logstash
- 12-19Zabbix SAML SSO 登录绕过漏洞的操作流程
- 12-15Docker-Compose搭建Spark集群的实现方法
- 12-14Docker Desktop无法正常启动解决(failed to start...)
- 12-14k8s 与docker空间使用分析与清理方法
- 12-13k8s编排之Deployment知识点详解
- 12-13Nginx IP封禁及自动封禁IP的实现
- 12-13Nginx代理Partainer如何使用





