NGINX Ingress Controller Configuration for Production Traffic

Timeouts, rate limits, TLS, and canaries tuned for a retired controller.

Cover illustration for “NGINX Ingress Controller Configuration for Production Traffic”

Sponsored by Porter

Written by
Ship It Yourself Editors
Published
November 28, 2026
Reading time
8 min read

Production NGINX Ingress Controller configuration is a balance between traffic control and operational risk. Timeouts, rate limits, TLS, canary routing, and monitoring still need careful tuning. But in 2026, the community controller is retired, so hardening an existing deployment must support a migration plan.

Why the kubernetes/ingress-nginx retirement changes every configuration decision made today

The kubernetes/ingress-nginx repository went read-only on March 24, 2026. Version 1.15.1 was its final release, shipping NGINX 1.27.1, and no further patches of any kind will be issued. Existing deployments can keep serving traffic, but their operators no longer have an upstream patch path when new vulnerabilities appear.

That does not make an immediate shutdown practical. Large clusters with hundreds of Ingress resources cannot migrate in a weekend, and rushing to replace them brings risks of its own. Teams need to prevent failures they can avoid while moving to a supported implementation, and weigh each new dependency on controller-specific behavior against the work it adds to migration.

What production-grade stability actually requires before any traffic tuning begins

A single under-provisioned controller replica is a more likely source of an outage than a badly chosen timeout. Availability comes before traffic tuning. Default Helm values are not a production baseline, so configure resource requests and limits, horizontal pod autoscaling, and a Pod Disruption Budget. Run at least three replicas with pod anti-affinity across different worker nodes so that losing one node cannot take down the whole ingress layer. Otherwise, rising gateway errors and latency spikes can lead responders to look for a fault in the application when the fault is at the edge.

Shutdown needs the same care as startup. Set terminationGracePeriodSeconds to at least 30 seconds and combine it with a preStop hook, allowing in-flight requests to finish and the load balancer to deregister the pod. In multi-controller clusters, bind each Ingress through ingressClassName to separate external and internal traffic without namespace collisions. That separation is not a tenant security boundary. The community controller assumes that people who can create Ingress resources have cluster-admin-level access, so sharing a controller is dangerous when tenants are not fully trusted, especially if they can use configuration snippets.

Getting timeout alignment right and why the defaults are a hidden failure mode

Diagram: Timeout Chain: The Required Ordering. Visualizes: Show the mandatory ordering of four timeout values that NGINX Ingress operators must respect to avoid hidden failures.

The standard 60-second read timeout becomes dangerous when retries turn one slow backend request into several. The intended ordering is client_timeout > L4_LB_idle_timeout > ingress_read_timeout > backend_processing_max. Separately, an L4 load balancer idle timeout at or below the ingress keep-alive setting can cut connections first, producing sporadic “Connection reset by peer” errors that appear to originate in the application. Keep backend connect timeouts to a few seconds at most, allowing time for slow starts that are working while limiting waits on faulty nodes.

Retries can multiply the damage under load. The default proxy-next-upstream behavior of error timeout, combined with three tries, can send a query that has already waited 60 seconds to other backend pods. An overloaded backend then receives more work precisely when it needs less. If retry-non-idempotent is enabled, duplicated POST requests can also duplicate orders or payments. For write paths, set proxy-next-upstream to off or restrict retries to non-destructive conditions, and set proxy-next-upstream-tries to one.

Rate limiting that actually works: why per-pod buckets break global limits and how to fix it

Rate-limit annotations create in-memory buckets in each controller pod. If every replica is set to the intended global per-IP limit, roughly that limit multiplied by the replica count can pass before limiting takes effect. Dividing the annotation value by the replica count accounts for that multiplication, but it does not turn separate buckets into a synchronized system. Autoscaling therefore makes the distinction between a per-pod setting and a global policy especially important.

Client identity is the other prerequisite for enforcement. NGINX keys these limits on $binary_remote_addr, so default externalTrafficPolicy behavior of Cluster, without Proxy Protocol or trusted forwarded-address parsing, can collapse users into node-internal or load-balancer SNAT addresses. Set externalTrafficPolicy to Local to preserve source IPs at the network level. Check the controller Service’s policy and look in the first log column, $remote_addr, to see whether it shows real clients or only internal addresses such as 10.x.x.x or 172.16.x.x. Before changing the ConfigMap during peak traffic, also check that there are at least two replicas and a Pod Disruption Budget, because the reload can briefly interrupt a deployment that has just one replica.

TLS configuration that does not create its own operational risk

Manual certificate renewal is an avoidable outage risk. Use cert-manager annotations to automate issuance through Let’s Encrypt or a private CA rather than relying on manually maintained certificates. The Ingress TLS stanza still references a Secret, which must contain the full certificate chain and private key. Disable TLS 1.0 and 1.1, enforce strong ciphers, and enable HSTS to keep browsers on HTTPS. Strip server version headers to reduce information leakage, and remove internal metadata headers before forwarding requests to backends.

F5’s advisory describes CVE-2026-77180, rated CVSS 8.3, as an injection flaw in its NGINX Ingress Controller configuration generator, where user-controlled fields enter generated configuration without sanitization. An authenticated attacker with annotation write access can inject directives, create or delete files, or disable services. Because controllers often read cluster-wide Secrets for TLS, that access can put much more than routing configuration at risk. The F5 product and the retired community project are separate, but the permission boundary needs a close look in either deployment. For the community controller, keep allow-snippet-annotations off, its default since v1.9, and require a security review when someone asks to turn it on.

Canary routing mechanics and what the annotation model can and cannot do

Diagram: Canary Routing: Fixed Selection Priority. Visualizes: Illustrate the fixed, non-configurable selection order for canary traffic routing in NGINX Ingress: Header rules are evaluated first, then Cookie rules, then Weight-based splitting.

Canary routing can split traffic by header, cookie, or weight for a gradual rollout without the need for a service mesh. Weight changes use the built-in Lua balancer dynamically, avoiding the reload-related latency spikes associated with full configuration changes. The selection order is fixed, however, with header rules taking priority over cookies, and cookies over weights. It cannot be rearranged through configuration. Only one Canary Ingress is allowed for each host-and-path combination, and adding another produces unpredictable routing.

In a stable-and-canary pair, the Canary Ingress identifies its target Service and split rules, including the canary weight, while timeout, body-size, and rate-limit settings belong on the Stable Ingress. Putting those shared settings on the canary does not override them. Argo Rollouts integration uses these annotations for percentage-based splitting regardless of pod count, rather than approximating weights through replica ratios. With that control, a small canary can catch a regression before it reaches the full fleet as well as make the cut-over more gradual.

Specific configuration requirements for LLM inference and streaming workloads

Default ingress settings can make LLM failures look like GPU or application bugs. Buffer sizing is one early fault line. The default proxy-buffer-size can be too small for a full streamed JSON chunk from vLLM, truncating responses before GPU capacity becomes the constraint. For longer completions, increase proxy-read-timeout from 60 seconds to at least 300 seconds. This timeout measures the interval between consecutive reads, so the relevant failure is a gap in upstream output.

Streaming also needs proxy-buffering set to off. Buffering delays delivery to the client and distorts first-byte latency and client timeout behavior, even when the backend is producing output. Behind the ingress layer, GPU-bound inference autoscaling should replace CPU usage with vLLM queue depth through KEDA as its scaling metric. A documented stack uses that pattern with vLLM 0.28.0, Kubernetes 1.34, and F5 NGINX Ingress Controller LTS 2026-lts-r1. Documented AI agent deployments also separate edge NGINX for TLS and rate limiting from internal NGINX for agent load balancing, with vLLM on A10G GPUs. Because infrastructure costs scale non-linearly with request volume, ingress sizing belongs in the same capacity discussion as GPU spending.

Observability configuration that makes the ingress layer debuggable

Enable Prometheus export and track request rates, latency percentiles, 5xx counts, and TLS handshake failures. Without those signals, a timeout mismatch or rate-limit false positive can remain indistinguishable from an application problem until users complain. Citibank’s optimization POC found that controller pods consumed 40% of their nodes’ CPU and memory, exposing worker over-provisioning and disabled keep-alive connections through Prometheus.

Logs show details about each request that those metrics leave out. Logging real client addresses helps with the source-IP check described earlier, while latency and error-rate alerts give responders a chance to act before the effect on service grows. Keep ingress manifests in Git, review configuration as code, and require review for route modifications. A traffic spike then has a change history against which it can be investigated. In multi-tenant clusters, the same review discipline helps constrain annotation changes rather than leaving sensitive controller configuration open to ad-hoc edits. Observability shows what changed at runtime, while GitOps records what was intended to change.

The compliance and audit exposure of running EOL ingress in regulated environments

Under SOC 2, PCI DSS, HIPAA, and ISO 27001, known end-of-life software in the request path creates audit exposure that traffic metrics cannot resolve. On AWS EKS, the controller is not installed by default, and patching responsibility rests with the operator. Managed Kubernetes does not absorb that responsibility. Engineering and compliance teams therefore need to distinguish controls that reduce present exposure from a supported patch path that addresses future vulnerabilities.

The annotation-injection issue also changes how exposure is scoped. In an affected deployment, the controller’s access to TLS Secrets means that annotation write permission can lead to a data-access finding as well as a configuration finding. The advisory’s affected product must remain explicit in that assessment rather than being applied indiscriminately to similarly named controllers. Meanwhile, teams using managed alternatives face their own timelines, with AKS managed NGINX add-on support ending in November 2026 and Google placing GKE Ingress in maintenance mode. Migration need not discard ingress consolidation, whose use of one cloud load balancer for multiple services can preserve meaningful infrastructure savings compared with per-service load balancers.

Migration paths available today and how to evaluate them against your cluster's constraints

Gateway API is the Kubernetes project’s designated replacement path. Its role-aware resources, including GatewayClass, Gateway, and HTTPRoute, replace controller-specific annotation sprawl with a more portable model. Implementations include Envoy Gateway, Istio, NGINX Gateway Fabric, Cilium, and kgateway. None is a universal drop-in replacement. The existing cluster, its routing requirements, and its dependence on annotation behavior determine which path fits, including whether the timeout, canary, and streaming controls described here can be expressed in the replacement.

For teams already using Cilium as their CNI, its Gateway API support is an option to look at because it fits the networking and Hubble observability setup they already have. Use the community-maintained patched image built on NGINX 1.31.9 that remediates the NGINX2Root CVEs as a bridge. Apply strict Ingress RBAC, keep snippets disabled, and monitor through Prometheus. Set the migration deadline against the next compliance audit cycle, so the temporary deployment has a clear end date and does not stay in place by default.

This article is sponsored by Porter.

Every new piece from Ship It Yourself, as it's published.

Follow