当前位置: 首页 > news >正文

Nginx 1.26+ 的主动 upstream 健康检查模块。

nginx-healthcheck-module

  • 博客链接
  • GitHub链接

用于 Nginx 1.26+ 的主动 upstream 健康检查模块。

本项目由 Akvicor 维护,修改自
yaoweibin/nginx_upstream_check_module。
当前版本保留主动健康检查模型,适配新版 Nginx upstream 内部结构,并聚焦于
http 与 stream upstream 的 TCP/UDP 检查。

因原项目无法适配新版本Nginx, 会导致检测异常,TIME_WAIT数量激增等各种问题, 因此这个版本中剔除了tcp/udp检查外的其他上游检查功能,增加了延迟统计,增加了TCP复用。

功能

  • 支持 Nginx 1.26+,仓库内提供对应 upstream 补丁。
  • 支持主动 type=tcp 和 type=udp 健康检查。
  • 支持 http upstream 和 stream upstream。
  • 可在 Nginx upstream 负载均衡过程中跳过不健康后端。
  • 状态接口支持 htmlcsvjsonprometheus 输出。
  • 状态输出中包含检查延迟统计:最后一次、平均、最小、最大延迟,单位毫秒。
  • 支持 TCP 健康检查连接复用:reuse=on

原项目中的 HTTP、FastCGI、MySQL、AJP、SSL hello 等七层检查,在当前维护版本中不再支持。

兼容性

  • 目标 Nginx 版本:1.26+。
  • 模块必须通过 --add-module 静态编译。
  • 暂不支持动态模块加载。
  • stream 健康检查要求 Nginx 编译时启用 --with-stream

仓库内补丁会为 Nginx 内置 HTTP 和 Stream upstream 负载均衡器添加主动健康检查过滤,
包括 round robin、hash、consistent hash、适用场景下的 ip_hash,以及 least_conn。

安装

git clone https://github.com/nginx/nginx.git
git clone https://github.com/Akvicor/nginx-healthcheck-module.gitcd nginx
git checkout release-1.26.3
git apply ../nginx-healthcheck-module/nginx_healthcheck_for_nginx_1.26+.patch./auto/configure --with-stream --add-module=../nginx-healthcheck-module
make
make install

请保留你当前 Nginx 构建所需的其他 configure 参数。如果需要 stream {} 健康检查,
需要保留 --with-stream

已编译好的debian源

先导入GPG密钥,用于验证包

curl -fsSL https://cdn.ksyaki.com/debian/nginx-team/public-key.asc \| gpg --dearmor --batch --yes -o /usr/share/keyrings/akvicor.gpg

Debian 13

tee /etc/apt/preferences.d/99-akvicor-nginx.pref >/dev/null <<'EOF'
Package: nginx nginx-* libnginx-mod-*
Pin: origin cdn.ksyaki.com
Pin-Priority: 1001
EOFecho "deb [signed-by=/usr/share/keyrings/akvicor.gpg] https://cdn.ksyaki.com/debian/nginx-team trixie main" \| tee /etc/apt/sources.list.d/akvicor-nginx.listapt update
apt install nginx

Debian 12

tee /etc/apt/preferences.d/99-akvicor-nginx.pref >/dev/null <<'EOF'
Package: nginx nginx-* libnginx-mod-*
Pin: origin cdn.ksyaki.com
Pin-Priority: 1001
EOFecho "deb [signed-by=/usr/share/keyrings/akvicor.gpg] https://cdn.ksyaki.com/debian/nginx-team bookworm main" \| tee /etc/apt/sources.list.d/akvicor-nginx.listapt update
apt install nginx

https://weibo.com/ttarticle/p/show?id=2309405301430013001793
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301430013001793
https://weibo.com/ttarticle/p/show?id=2309405301430180511752
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301430180511752
https://weibo.com/ttarticle/p/show?id=2309405301430344351818
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301430344351818
https://weibo.com/ttarticle/p/show?id=2309405301430528901129
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301430528901129
https://weibo.com/ttarticle/p/show?id=2309405301430692216953
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301430692216953
https://weibo.com/ttarticle/p/show?id=2309405301430859989022
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301430859989022
https://weibo.com/ttarticle/p/show?id=2309405301431028023417
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301431028023417
https://weibo.com/ttarticle/p/show?id=2309405301431195795520
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301431195795520
https://weibo.com/ttarticle/p/show?id=2309405301431359111307
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301431359111307
https://weibo.com/ttarticle/p/show?id=2309405301431531339952
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301431531339952
https://weibo.com/ttarticle/p/show?id=2309405301431698849880
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301431698849880
https://weibo.com/ttarticle/p/show?id=2309405301432151834719
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432151834719
https://weibo.com/ttarticle/p/show?id=2309405301432210817387
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432210817387
https://weibo.com/ttarticle/p/show?id=2309405301432273731606
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432273731606
https://weibo.com/ttarticle/p/show?id=2309405301432332189876
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432332189876
https://weibo.com/ttarticle/p/show?id=2309405301432391172211
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432391172211
https://weibo.com/ttarticle/p/show?id=2309405301432454086769
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432454086769
https://weibo.com/ttarticle/p/show?id=2309405301432512544896
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432512544896
https://weibo.com/ttarticle/p/show?id=2309405301432571265255
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432571265255
https://weibo.com/ttarticle/p/show?id=2309405301432634179726
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432634179726
https://weibo.com/ttarticle/p/show?id=2309405301432692899975
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432692899975
https://weibo.com/ttarticle/p/show?id=2309405301432756076594
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432756076594
https://weibo.com/ttarticle/p/show?id=2309405301432814534675
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432814534675
https://weibo.com/ttarticle/p/show?id=2309405301432873517129
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432873517129
https://weibo.com/ttarticle/p/show?id=2309405301432931975278
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432931975278
https://weibo.com/ttarticle/p/show?id=2309405301432990957771
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301432990957771
https://weibo.com/ttarticle/p/show?id=2309405301433049677911
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433049677911
https://weibo.com/ttarticle/p/show?id=2309405301433120718968
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433120718968
https://weibo.com/ttarticle/p/show?id=2309405301433179701313
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433179701313
https://weibo.com/ttarticle/p/show?id=2309405301433238159473
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433238159473
https://weibo.com/ttarticle/p/show?id=2309405301433296879938
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433296879938
https://weibo.com/ttarticle/p/show?id=2309405301433355862170
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433355862170
https://weibo.com/ttarticle/p/show?id=2309405301433418776590
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433418776590
https://weibo.com/ttarticle/p/show?id=2309405301433477234738
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433477234738
https://weibo.com/ttarticle/p/show?id=2309405301433535955047
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433535955047
https://weibo.com/ttarticle/p/show?id=2309405301433594937448
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433594937448
https://weibo.com/ttarticle/p/show?id=2309405301433653395582
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433653395582
https://weibo.com/ttarticle/p/show?id=2309405301433712378139
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433712378139
https://weibo.com/ttarticle/p/show?id=2309405301433775030312
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433775030312
https://weibo.com/ttarticle/p/show?id=2309405301433833750807
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433833750807
https://weibo.com/ttarticle/p/show?id=2309405301433892470943
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433892470943
https://weibo.com/ttarticle/p/show?id=2309405301433951453336
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301433951453336
https://weibo.com/ttarticle/p/show?id=2309405301434009911448
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301434009911448
https://weibo.com/ttarticle/p/show?id=2309405301434073088016
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301434073088016
https://weibo.com/ttarticle/p/show?id=2309405301434131808270
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301434131808270
https://weibo.com/ttarticle/p/show?id=2309405301434190266434
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301434190266434
https://weibo.com/ttarticle/p/show?id=2309405301434249248950
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301434249248950
https://weibo.com/ttarticle/p/show?id=2309405301434307707057
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301434307707057
https://weibo.com/ttarticle/p/show?id=2309405301373834494239
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301373834494239
https://weibo.com/ttarticle/p/show?id=2309405301373897146393
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301373897146393
https://weibo.com/ttarticle/p/show?id=2309405301373955866649
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301373955866649
https://weibo.com/ttarticle/p/show?id=2309405301374014586901
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374014586901
https://weibo.com/ttarticle/p/show?id=2309405301374073307229
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374073307229
https://weibo.com/ttarticle/p/show?id=2309405301374136484104
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374136484104
https://weibo.com/ttarticle/p/show?id=2309405301374199398429
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374199398429
https://weibo.com/ttarticle/p/show?id=2309405301374257856535
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374257856535
https://weibo.com/ttarticle/p/show?id=2309405301374316839141
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374316839141
https://weibo.com/ttarticle/p/show?id=2309405301374375297387
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374375297387
https://weibo.com/ttarticle/p/show?id=2309405301374438473814
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374438473814
https://weibo.com/ttarticle/p/show?id=2309405301374497194005
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374497194005
https://weibo.com/ttarticle/p/show?id=2309405301374555914245
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374555914245
https://weibo.com/ttarticle/p/show?id=2309405301374610178226
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301374610178226
https://weibo.com/ttarticle/p/show?id=2309405301329118757359
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329118757359
https://weibo.com/ttarticle/p/show?id=2309405301329181671449
https://weibo.com/ttarticle/p/show?id=2309405301329240391826
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329240391826
https://weibo.com/ttarticle/p/show?id=2309405301329303306258
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329303306258
https://weibo.com/ttarticle/p/show?id=2309405301329362026683
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329362026683
https://weibo.com/ttarticle/p/show?id=2309405301329420746992
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329420746992
https://weibo.com/ttarticle/p/show?id=2309405301329479467102
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329479467102
https://weibo.com/ttarticle/p/show?id=2309405301329542381831
https://weibo.com/ttarticle/p/show?id=2309405301329618141314
https://weibo.com/ttarticle/p/show?id=2309405301329697833241
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329697833241
https://weibo.com/ttarticle/p/show?id=2309405301329760485417
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329760485417
https://weibo.com/ttarticle/p/show?id=2309405301329827594319
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329827594319
https://weibo.com/ttarticle/p/show?id=2309405301329899159657
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301329970200618
https://weibo.com/ttarticle/p/show?id=2309405301330028920904
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330028920904
https://weibo.com/ttarticle/p/show?id=2309405301330087903335
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330146623495
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330205081672
https://weibo.com/ttarticle/p/show?id=2309405301330272190495
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330272190495
https://weibo.com/ttarticle/p/show?id=2309405301330330910783
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330330910783
https://weibo.com/ttarticle/p/show?id=2309405301330582569334
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330582569334
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330645745689
https://weibo.com/ttarticle/p/show?id=2309405301330704465926
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330704465926
https://weibo.com/ttarticle/p/show?id=2309405301330762924040
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330821644327
https://weibo.com/ttarticle/p/show?id=2309405301330880626790
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330880626790
https://weibo.com/ttarticle/p/show?id=2309405301330939347091
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330939347091
https://weibo.com/ttarticle/p/show?id=2309405301330997805110
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301330997805110
https://weibo.com/ttarticle/p/show?id=2309405301331056787611
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301331056787611
https://weibo.com/ttarticle/p/show?id=2309405301331115507810
https://weibo.com/ttarticle/p/show?comment=1&id=2309405301331115507810

 

 
http://www.jsqmd.com/news/866036/

相关文章:

  • 【MATLAB】图像压缩编码与传输优化算法研究与实现
  • 从‘扫描全能王’到‘启信宝’:聊聊合合信息这家低调的数据公司
  • 2026 年 5 月青岛首饰回收行业深度解读!六家正规机构实力剖析,行业标杆添价收已定 - 薛定谔的梨花猫
  • Claude Code 本地部署如何通过 Taotoken 稳定调用大模型 API
  • 用达尔文进化论重构神经网络设计
  • 深度解析YOLOv8在ROS 2中的智能视觉集成方案:5大优势与实战指南
  • 创业团队如何利用多模型聚合能力低成本开发AI应用
  • 别再折腾环境了!手把手教你用Docker一键部署NeRF Studio(含CUDA 11.8配置)
  • 别再只用DataView了!Obsidian Tasks插件这样用,让你的待办清单效率翻倍
  • 解锁微信QQ语音的钥匙:silk-v3-decoder音频转换全攻略
  • 2026年阿里云OpenClaw/Hermes Agent配置Token Plan部署步骤详解
  • 企业级应用如何通过Taotoken统一管理多个AI模型的API调用与成本
  • 如何3分钟搞定微信QQ语音转换:silk-v3-decoder终极指南
  • 告别Windows内存卡顿:Mem Reduct智能清理实战手册
  • 旅游数据|基于Java+vue的旅游数据分享系统(源码+数据库+文档)​
  • 油气EPC项目超支预测:Hybrid AI混合建模实战指南
  • XU9250B,输入电压范围:2.7V至16V 7A异步升压芯片
  • 2026年阿里云OpenClaw/Hermes Agent配置Token Plan安装超全攻略
  • 避坑指南:在Jetson Orin Nano上编译支持CUDA的OpenCV 4.5.3,我踩过的雷都在这了
  • 如何高效解决多云存储兼容问题?Alibaba Cloud OSS SDK实战指南
  • ZenTimings终极指南:轻松监控AMD Ryzen内存时序的免费神器
  • 2026株洲奢侈品回收市场观察:包包回收迈入规范时代,湘奢汇(天元店)领衔五大靠谱机构 - 生活测评小能手
  • 对比官方价Taotoken活动价在长期使用中的成本优势感受
  • 5分钟掌握免费LOL换肤工具:国服专用内存注入技术终极指南
  • 热敏开关选型与安装实战:从原理到应用的温度保护方案
  • 如何让炉石传说佣兵战记自动化?解放双手的智能助手lushi_script深度解析
  • 浏览器中优雅查看Markdown文件的终极解决方案:Markdown Viewer完全指南
  • 从UI稿到上线:手把手教你搞定ECharts图例与设计稿的‘神同步’(以直线图例为例)
  • GitHub Copilot @workspace 保姆级实战:从代码优化到接口Mock,5个真实场景搞定
  • Lovable前端不是UI美化,而是工程决策——看头部电商如何用2周将NPS提升37%(含埋点与归因模型)