Fractal Techware

Alert runbooks /

NginxIngressHighHttp4xxErrorRate

A large share of requests through one Ingress are being rejected with 4xx codes for a long stretch.

   
Severity info
Source ingress-nginx controller /metrics (1.9+)
Key metric nginx_ingress_controller_requests (labels namespace, ingress, status)

What it means

4xx responses are normally the client’s fault, so some are expected. This alert fires only when a big portion of an Ingress’s traffic has been 4xx for a sustained period, and only for Ingresses with real traffic. It is informational: nothing is necessarily broken, but a pattern like this often hides a real problem, such as a broken frontend calling the wrong path, expired tokens, or someone scanning your site.

Common causes

First checks

  1. Break the errors down by code:
    sum by (namespace, ingress, status) (rate(nginx_ingress_controller_requests{status=~"4.."}[5m]))
    
  2. Find the top paths and client IPs producing them from the access log:
    kubectl -n ingress-nginx logs deploy/ingress-nginx-controller --since=30m \
      | grep '<host>' | grep -E '" 4[0-9]{2} ' | awk '{print $1, $7, $9}' | sort | uniq -c | sort -rn | head -20
    

    Field positions depend on your log-format-upstream; adjust as needed.

  3. Compare the Ingress rules with what clients request:
    kubectl -n <namespace> get ingress <ingress> -o yaml
    
  4. If 401/403 dominate, check the auth service or identity provider logs, and any nginx.ingress.kubernetes.io/auth-* annotations.

Fixing it

Fix routing mistakes in the Ingress or restore the old path with a redirect. Raise nginx.ingress.kubernetes.io/proxy-body-size for legitimate large uploads. Loosen rate limits if real users hit them. For scanners, consider blocking at a WAF or with denylist-source-range, or exclude that Ingress from the alert if the noise is expected.