环境

CentOS Linux release 8.5.2111
Linux OPS 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Wed Dec 22 13:25:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
GitLab Community Edition 14.6.1

问题

着手维护业务时发现 gitlab 日志文件异常大,观察发现一秒钟内有多个重复健康检查,且持续不断。
请求来源 100.123.x.x,请求信息为"HEAD /"。
检查内网无 100.x.x.x 网段,排除内网网段,100.64.0.0/10 网段为阿里云内部保留地址;
检查 gitlab 为容器部署,健康检查 URI 应该为"/health";阿里云lb等其他默认检查地址为"HEAD /";
检查确认 gitlab 与阿里云 lb 之间不存在其他网关、或组件。
检查阿里云lb,未发现有业务开启健康检查。

{"content_type":"text/html; charset=utf-8","correlation_id":"01KRWYNR0Q0D43PC3GNSBW2Y52","duration_ms":14,"host":"gitlab.xxx.com","level":"info","method":"HEAD","msg":"access","proto":"HTTP/1.1","referrer":"","remote_addr":"100.123.1.75:0","remote_ip":"100.123.1.75","route":"","status":302,"system":"http","time":"2026-05-18T07:09:14Z","ttfb_ms":14,"uri":"/","user_agent":"","written_bytes":0}

==> /var/log/gitlab/nginx/gitlab_access.log <==
100.123.1.75 - - [18/May/2026:07:09:14 +0000] "HEAD / HTTP/1.0" 302 0 "" "-" -

==> /var/log/gitlab/gitlab-rails/production.log <==
Started HEAD "/" for 100.123.1.0 at 2026-05-18 07:09:15 +0000
Processing by RootController#index as HTML
Redirected to http://gitlab.xxx.com/users/sign_in
Filter chain halted as :redirect_unlogged_user rendered or redirected
Completed 302 Found in 5ms (ActiveRecord: 0.0ms | Elasticsearch: 0.0ms | Allocations: 3280)

==> /var/log/gitlab/gitlab-rails/production_json.log

所有信息都指向阿里云配置问题,但是阿里云配置却无问题,随即工单确认:LB确实存在健康检查请求发起,可能为历史遗留导致界面显示与后台不一致。

解决

在 http 与 https 中配置转发策略,找到对应的业务进行编辑转发策略,启用"转发规则高级配置",并将"开启健康检查"设置为关闭,之后确认即可,确认重复健康检查请求消失。
目的为强制刷新前台显示与后端实际策略一致,后续可关闭"转发规则高级配置"。

最后修改:2026 年 06 月 08 日 10 : 24 AM
如果觉得文章帮助了您,您可以随意赞赏。