忽略 php-fpm 访问日志中的健康检查

问题描述

现在在 Docker 中运行 Nginx 和 php-fpm。我目前正在计划这些运行状况检查以命中 php-fpm 的 decimal uri,这样它就会向 LB 显示 nginx 和 php 都在运行。这一切都有效。

但是,我正在尝试过滤或忽略 PHP-FPM 方面的负载均衡器运行状况检查。我已经让 Nginx 没有记录那些 var result = eimsRecs .Concat(aaRecs) .Concat(mtrRecs) .GroupBy(f => new { f.FAN,f.Prefix }) .Select(g => new Unbilled() { Pid = g.First().Pid,AgrmntId = g.First().AgrmntId,UnbilledAmount = g.Sum(rec => rec.UnbilledAmount),... }) .ToList(); 用户代理。

所以我想要么基于 PHP-FPM 中的相同用户代理过滤掉,要么不将 ping.path = /ping 记录到 access_log。

我没有以损坏的代码为例,因为我不确定在 php-fpm 的 confs 中甚至可以使用哪些选项来执行此操作。但这是我目前正在使用的一些代码:

Nginx:一切正常

"~*GoogleHC\/1.0"

在 PHP-FPM 方面(在我的 www.conf 中):

/ping

和 access_log.conf:

map $http_user_agent $ignore_status_checks {
    default                 0;
    "~*GoogleHC\/1.0"       1;
}

...

    location ~ ^/(status|ping)$ {
        if ($ignore_status_checks) {
            access_log off;
        }

        include fastcgi_params;
        fastcgi_pass php:9000;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        fastcgi_index index.php;
    }

同样,所有这些代码都有效,我只想在 php-fpm 的 access_log 上过滤掉 [www] listen = 127.0.0.1:9000 pm = dynamic pm.status_path = /status ping.path = /ping ... and other unrelated definitions 或基于用户代理的健康检查。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...