Nginx Status Code 499 using Google Cloud Kubernetes TCP Load Balancer

12/3/2019

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

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.

-- john
google-cloud-load-balancer
google-kubernetes-engine
nginx
nginx-ingress

2 Answers

12/4/2019

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;

See http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort

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

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

-- john
Source: StackOverflow

12/4/2019

This error code 499 relates to the clients browser closing the connections before a response is sent from the backends.

-- Rahul Singh
Source: StackOverflow