NGINX Ingress Is Retired: Two Ways to Keep oauth2-proxy Working on ALB

NGINX Ingress Is Retired: Two Ways to Keep oauth2-proxy Working on ALB

Your OIDC login breaks silently during the migration because the auth annotations are ignored. Here are two patterns that work, with complete manifests, the security group rule everyone forgets, the header mapping, and guidance on which to pick.

Been running oauth2-proxy behind NGINX Ingress on EKS? Then you probably already know what's coming. The NGINX Ingress Controller was retired in March 2026, and if you're like most teams, you're now staring at the inevitable migration to ALB-based ingress.
Here's the part nobody warns you about. You swap  ingressClassName: nginx to  ingressClassName: alb , redeploy, everything looks green… and your authentication just vanishes. No errors. No warnings in the logs. Traffic flows straight to your backend, completely unauthenticated. Your  nginx.ingress.kubernetes.io/auth-url and  auth-signin annotations are silently ignored by the AWS Load Balancer Controller. It doesn't complain. It just lets everyone in.
That's actually terrifying.
The good news? There are two clean patterns to fix this, and this week AWS published a migration guide covering both. Let me walk you through the trade-offs so you can pick the right one—and then we'll get our hands dirty with actual YAML.

The Silent Breakage Nobody Warned You About 😤

Let's be real about why this migration hurts so much:
  • 🔓 Auth annotations disappear silently — ALB doesn't recognize NGINX-specific annotations, so  auth-url and  auth-signin are just… ignored. No 4xx, no log entry. Wide-open traffic.
  • 🔄 Architecture mismatch — With NGINX, the Ingress pointed to your backend and used subrequests for auth. Keep oauth2-proxy on ALB (Solution 1 below) and the Ingress backend must point at oauth2-proxy itself—a fundamentally different wiring.
  • 🔑 Header contract changes — Even if you wire up ALB's native OIDC, it sends tokens in  x-amzn-oidc-accesstoken , not the  Authorization: Bearer header your backend probably expects. Subtle. Breaking.
  • 🧩 IdP callback registration — ALB native OIDC uses a fixed callback path ( /oauth2/idpresponse ) that must be registered with your identity provider. Miss this—it's reportedly the most common mistake—and you'll stare at redirect errors for hours.

Two Patterns That Actually Fix This

Solution 1: Reverse Proxy Mode — Keep oauth2-proxy, but switch it from subrequest mode to reverse proxy mode. ALB sends all traffic to oauth2-proxy first; oauth2-proxy handles auth, then proxies authenticated requests to your backend. Low change: three flags plus an Ingress backend swap. Backward-compatible.
Solution 2: ALB Native OIDC — Let ALB handle the OIDC flow itself using  authenticate-oidc action annotations. Medium change: new annotations plus an IdP callback registration for  /oauth2/idpresponse . Different header contract.
Both work. The right choice depends on how tightly your backend relies on that  Authorization: Bearer header and how comfortable you are coupling auth logic to your load balancer.

Solution 1: Keep oauth2-proxy (Reverse Proxy Mode) 🔧

The key architectural shift is that your Ingress backend now points to oauth2-proxy on port 4180, not your application directly. oauth2-proxy handles both authentication and proxying to your upstream service. It's like putting a bouncer at the front door who also walks you to your table.
You need three additional flags on your oauth2-proxy deployment:
  •  --upstream=http://my-app.default.svc.cluster.local:8080  — where to send authenticated requests
  •  --reverse-proxy=true  — trust  X-Forwarded headers from ALB
  •  --pass-authorization-header=true  — forward  Authorization: Bearer <token> to your upstream
Here's the magic part: this change is actually backward-compatible. oauth2-proxy in reverse proxy mode still responds to  /oauth2/auth subrequests, so your existing NGINX Ingress keeps working while you validate the ALB path. You can run both in parallel. No big-bang cutover required.

Solution 2: ALB Native OIDC

Meet the simpler stack. With native OIDC, ALB performs the entire OpenID Connect flow itself through Ingress annotations. You configure everything declaratively—no extra proxy pods in the request chain.
But here's what you need to internalize: after authentication, ALB forwards three headers to your backend— x-amzn-oidc-accesstoken  (access token JWT),  x-amzn-oidc-identity (user identity), and  x-amzn-oidc-data (ALB-signed JWT with user claims). Notice what's missing? The standard  Authorization: Bearer header. If your app expects it, that's a breaking change you'll need to handle in code.
You must also register  https://app.example.com/oauth2/idpresponse as a redirect URL with your identity provider. Don't skip it.

Let's Get Our Hands Dirty

Alright, enough talking. I know you want to see this wired up.
Everything below is in a companion repo:  eks-oauth2-proxy-alb . It carries the two Ingress manifests plus the pieces they reference but that articles usually leave out — the app workload and the oauth2-proxy deployment — with  deploy.sh ,  verify.sh  and  cleanup.sh . Clone it, fill in  .env , and run one pattern end to end.

Step 1: Install the AWS Load Balancer Controller

The latest release is v3.6.0. Install it via Helm with IRSA—that's the best practice for EKS, rather than attaching permissions directly to node IAM roles:
helm repo add eks https://aws.github.io/eks-charts
helm repo update

helm install aws-load-balancer-controller eks/aws-load-balancer-controller \
-n kube-system \
--set clusterName=<cluster-name> \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller

Before deploying any Ingress, verify three prerequisites: subnets tagged with  kubernetes.io/role/internal-elb: 1 , an ACM certificate provisioned, and the  alb IngressClass present. Also confirm your node security group allows TCP 9443 inbound from the control plane—the controller needs that for webhook traffic.

Step 2: Deploy Solution 1 — Reverse Proxy Ingress

Make sure your oauth2-proxy deployment includes the three new flags from above. Then deploy this Ingress—notice the backend is  oauth2-proxy on port  4180 , not your app:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-alb
annotations:
alb.ingress.kubernetes.io/scheme: internal
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS13-1-2-2021-06
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:REGION:ACCOUNT:certificate/CERT-ID
alb.ingress.kubernetes.io/target-group-attributes: >-
stickiness.enabled=true,stickiness.lb_cookie.duration_seconds=86400
spec:
ingressClassName: alb
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: oauth2-proxy
port:
number: 4180

One thing that will absolutely bite you: add a security group inbound rule allowing TCP 4180 from the ALB security group to your cluster/node security group. Without it, health checks fail silently and you'll wonder why everything times out.

Step 3: Deploy Solution 2 — Native OIDC Ingress 🔑

First, create the Kubernetes secret that ALB will use for the OIDC client credentials:
kubectl create secret generic alb-oidc-secret \
--from-literal=clientId=my-app \
--from-literal=clientSecret=YOUR_CLIENT_SECRET
Then deploy the Ingress with native OIDC annotations. The  auth-idp-oidc annotation takes a JSON object referencing your secret by  secretName :
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-alb-oidc
annotations:
alb.ingress.kubernetes.io/scheme: internal
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS13-1-2-2021-06
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:REGION:ACCOUNT:certificate/CERT-ID
alb.ingress.kubernetes.io/auth-type: oidc
alb.ingress.kubernetes.io/auth-idp-oidc: >-
{"issuer":"https://idp.example.com",
"authorizationEndpoint":"https://idp.example.com/authorize",
"tokenEndpoint":"https://idp.example.com/oauth/token",
"userInfoEndpoint":"https://idp.example.com/userinfo",
"secretName":"alb-oidc-secret"}
alb.ingress.kubernetes.io/auth-scope: openid
alb.ingress.kubernetes.io/auth-session-timeout: "604800"
spec:
ingressClassName: alb
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app
port:
number: 8080

Notice the backend points directly to your app here—no oauth2-proxy in the chain. The  auth-session-timeout defaults to  604800 (7 days) and  auth-scope defaults to  openid , so those annotations are actually optional if the defaults work for you.

Watch the Magic Happen ✨

So what actually happens when a request hits each solution?
Solution 1: ALB forwards the request to oauth2-proxy on port 4180. oauth2-proxy redirects the user to your IdP, completes the OIDC dance, then proxies the authenticated request to your upstream service with the familiar  Authorization: Bearer <token> header. Your backend code doesn't change. At all.
Solution 2: ALB itself redirects the user to your IdP, exchanges the code at  /oauth2/idpresponse , sets a session cookie, then forwards the request to your backend with  x-amzn-oidc-accesstoken ,  x-amzn-oidc-identity , and  x-amzn-oidc-data headers. Simpler flow, different contract.


Step 4: Clean Up 🧹

An ALB bills by the hour whether anyone is using it or not, so tear this down when you're done experimenting.
Delete the Ingress first. That is the object the controller watches, and removing it is what deletes the load balancer. Tear down the cluster while the Ingress still exists and the controller disappears before it can clean up, leaving an ALB behind that nothing in Kubernetes is tracking any more:
kubectl delete ingress my-app-alb my-app-alb-oidc --ignore-not-found

# give the controller a moment to delete the ALB before removing its backends
sleep 20

kubectl delete deploy,svc my-app oauth2-proxy --ignore-not-found
kubectl delete secret oauth2-proxy alb-oidc-secret --ignore-not-found
Then check nothing was left behind, because an orphaned load balancer is the sort of thing you discover on next month's bill:

aws elbv2 describe-load-balancers --query 'LoadBalancers[].LoadBalancerName'
One more thing for Solution 1: the inbound rule allowing TCP 4180 from the ALB security group outlives everything above. Remove it with the rest, or it sits there pointing at nothing.


When to Use Which

Use Solution 1 (Reverse Proxy) when:
  • Your backend expects  Authorization: Bearer and you can't or don't want to change it
  • You need NGINX and ALB running in parallel during migration
  • You want IdP-agnostic auth logic that isn't coupled to your load balancer
  • You need custom claim mapping or token enrichment that oauth2-proxy provides
** Use Solution 2 (Native OIDC) when:**
  • You want fewer components to operate and monitor
  • Your backend can read  x-amzn-oidc-accesstoken or you can adapt it
  • You're deep in the AWS ecosystem and the coupling doesn't bother you
  • You want ALB to handle session management with its built-in cookie
Avoid Solution 2 if:
  • You're planning multi-cloud and don't want auth logic baked into ALB
  • Your IdP doesn't have publicly resolvable DNS or uses private CA certificates
  • You're on an internal ALB without a NAT gateway (ALB only speaks IPv4 to IdP endpoints)

The Reality Check (Because Nothing's Perfect)

There is no free lunch. Here's what you need to know before committing:
  1. HTTPS only, no exceptions — ALB's  authenticate-oidc action type is supported only with HTTPS listeners. If you're still running plain HTTP internally... it's about damn time to fix that.
  1. IdP reachability is strict — Your IdP's DNS must be publicly resolvable, and its endpoint certificates must come from a trusted public certificate authority. ALB communicates with IdP endpoints over IPv4 only—so internal ALBs need a NAT gateway to reach those endpoints. That's additional cost and infrastructure you might not have planned for.
  1. Rule limits add up — Each ALB supports a maximum of 100 rules (excluding defaults). If you're running dozens of services behind one ALB, you can hit this ceiling faster than you'd expect. The limit is adjustable, but worth tracking from day one.
  1. Defaults are sneaky — The default  ssl-policy is  ELBSecurityPolicy-2016-08 (yes, 2016). The default  scheme is  internal . The default  target-type is  instance , not the  ip mode the migration guide uses. Be explicit about all of these or you'll get behavior that looks correct but isn't what you intended.
  1. Session timeout is generous — The default  auth-session-timeout is 604800 seconds (7 days). That might be fine for internal tools, but for anything customer-facing you probably want to tighten it. You can go as short as 1 second.
But honestly? These are all manageable constraints. The two solutions cover the vast majority of migration scenarios, and the parallel-run capability makes the transition far less scary than it sounds.

The Migration Path 🛤️

Don't go big bang. The recommended approach:
  1. Deploy your ALB Ingress under a separate hostname like  app-alb.example.com while production stays on NGINX
  1. Validate the auth flow end-to-end on the new hostname
  1. When confident, use Route 53 weighted DNS records on the production hostname for gradual cutover
  1. Once 100% of traffic is on ALB, decommission the NGINX Ingress Controller
Solution 1's backward compatibility is the real hero here—oauth2-proxy serves both NGINX subrequests and ALB reverse proxy traffic simultaneously during the parallel run. No code changes needed.

Wrapping Everything Up

So, should you actually panic about the NGINX Ingress retirement? No. But you should move on it, because that silent auth bypass is genuinely dangerous—unauthenticated traffic flowing to your backend with zero warnings in the logs.
The fix is straightforward. Either keep oauth2-proxy in reverse proxy mode (three flags and a backend swap) or go all-in on ALB native OIDC (fewer components, different header contract). The trade-off is clear: Solution 1 preserves your existing auth contract with minimal change; Solution 2 simplifies your stack but couples auth to the load balancer and changes how tokens reach your backend.
Pick the one that matches your constraints, run them in parallel, and cut over with confidence. And honestly? Having two well-documented paths for the same migration is more than we usually get. ✨



Resources

Companion repo

Migration Guide

Documentation

Installation & Releases

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article