Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Argo CD behind an nginx Ingress loops with too many redirects

Errorredirect loop when opening the Argo CD host

Short answer

The browser and Argo CD disagree about who handles TLS. If the Ingress terminates TLS, argocd-server must run with server.insecure set to true and the Ingress must talk plain HTTP to it. If argocd-server keeps TLS, use ssl-passthrough or backend-protocol HTTPS. Pick one model and make every setting agree with it.

  • Applies to Argo CD 2.x and 3.x, ingress-nginx controller, Kubernetes 1.30+
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask for the response without following redirects and see where it points. A Location that sends https back to the same https host means the loop is inside the cluster path, not in the browser.

    curl -sk -o /dev/null -D - https://argocd.example.com/ | head -n 8
    kubectl -n argocd get cm argocd-cmd-params-cm -o jsonpath='{.data.server\.insecure}'
  2. 2Match what you see, then jump to its fix

    1. 1The ConfigMap query prints nothing or false, and the Ingress has a tls: section with backend-protocol HTTP or no annotationThe Ingress terminates TLS but argocd-server still serves TLSFix
    2. 2A 307 or a loop while server.insecure is not set and the Ingress sends plain HTTPbackend-protocol does not match what argocd-server speaksFix
    3. 3The Ingress has ssl-passthrough: "true", yet the controller behaves as if TLS is terminatedssl-passthrough is set but the controller was not started with itFix

What does the error look like?

  • redirect loop when opening the Argo CD host
  • 307 Temporary Redirect on every request to the Argo CD host

Cause 1 of 3

The Ingress terminates TLS but argocd-server still serves TLS

1Check

When the controller ends TLS, the Argo CD docs say the API server must run with TLS disabled. Look at the setting in argocd-cmd-params-cm.

kubectl -n argocd get cm argocd-cmd-params-cm -o yaml | grep -n insecure

2Fix

Set server.insecure to true in argocd-cmd-params-cm (the other documented way is adding --insecure to the argocd-server command). Keep the Ingress backend on the HTTP port of the argocd-server service.

kubectl -n argocd patch cm argocd-cmd-params-cm --type merge -p '{"data":{"server.insecure":"true"}}'

3Verify

The page loads once, without a chain of redirects.

curl -sI https://argocd.example.com/ | head -n 1

Confirmed by argo-cd.readthedocs.io

Did this fix it?

Cause 2 of 3

backend-protocol does not match what argocd-server speaks

1Check

ingress-nginx talks HTTP to the backend unless told otherwise. If argocd-server is still on TLS, nginx and Argo CD keep bouncing the request. Read the annotation on your Ingress.

kubectl -n argocd get ingress -o yaml | grep -n 'backend-protocol\|ssl-passthrough'

2Fix

If you keep TLS on argocd-server, tell nginx to connect with HTTPS. The Argo CD docs give this annotation for exactly the redirect-loop and 307 case, and the backend port is then the https port of the service.

metadata:
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"

3Verify

Request the host again and confirm a single 200 or login redirect.

curl -skI https://argocd.example.com/ | head -n 3

Confirmed by argo-cd.readthedocs.io

Did this fix it?

Cause 3 of 3

ssl-passthrough is set but the controller was not started with it

1Check

Passthrough is off by default and only works when the controller runs with --enable-ssl-passthrough. The ingress-nginx docs also say passthrough makes every other annotation on that Ingress ineffective, so a redirect annotation you rely on is ignored.

kubectl -n ingress-nginx get deploy ingress-nginx-controller -o yaml | grep -n enable-ssl-passthrough

2Fix

Add --enable-ssl-passthrough to the controller arguments, or drop passthrough and use the terminate-at-Ingress model from the first cause. In passthrough mode leave server.insecure unset.

# controller container args
- --enable-ssl-passthrough

3Verify

The controller pod restarts, and the Argo CD host answers over its own certificate.

kubectl -n ingress-nginx rollout status deploy ingress-nginx-controller

Confirmed by kubernetes.github.io

Did this fix it?

How do I stop it coming back?

  • Write down the TLS model before you write the Ingress: terminate at the controller, or pass through to Argo CD. Never mix halves of both.
  • Keep server.insecure and the Ingress annotations in the same Git change so they cannot drift apart.
  • Remember that the ingress-nginx project is archived; plan a move to a maintained controller and re-check these settings then.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.