本文介绍了使用Google Cloud Kubernetes TCP负载均衡器的Nginx状态代码499的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用公开的Nginx Ingress控制器在GKE上运行,该控制器暴露在由Kubernetes自动配置的TCP负载均衡器下.

We are running on GKE using a public-facing Nginx Ingress Controller exposed under a TCP Load Balancer which is automatically configured by Kubernetes.

问题在于,我们的请求中有0.05%的状态码为499(Nginx唯一的状态码,表示客户端已取消).我们的P99延迟平均总是低于100毫秒.

The problem is that 0.05% of our requests have status code 499 (An Nginx unique status code which means that the client cancelled). Our P99 Latency on average is always below 100ms.

推荐答案

按照 .

As per DerSkythe's answer.

我的问题通过在配置映射中添加以下内容来解决.

My problem is solved by adding the following in the config map.

apiVersion: v1
kind: ConfigMap
data:
  http-snippet: |
    proxy_ignore_client_abort on;

请参见 http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort

启用此功能后,我的499错误几乎为零!

After turning this on, I have almost zero 499 errors!

如果您遇到相同的问题,我强烈建议尝试此配置.

I highly recommend trying this configuration if you are encountering the same problem.

这篇关于使用Google Cloud Kubernetes TCP负载均衡器的Nginx状态代码499的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 23:00