Argo CD behind an nginx Ingress loops with too many redirects
redirect loop when opening the Argo CD hostShort 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.
Fix it fast
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}'2Match what you see, then jump to its fix
- 1
The 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
A 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
The 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
- 1
What does the error look like?
redirect loop when opening the Argo CD host307 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 insecure2Fix
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 1Confirmed by argo-cd.readthedocs.io
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 3Confirmed by argo-cd.readthedocs.io
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-passthrough2Fix
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-passthrough3Verify
The controller pod restarts, and the Argo CD host answers over its own certificate.
kubectl -n ingress-nginx rollout status deploy ingress-nginx-controllerConfirmed by kubernetes.github.io
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- Dispatch ProA real-time logistics platform: Flutter apps, Spring Boot services and a Kafka event pipeline on AWS.
- stegnor.comMy company site: 804 pages from a Python and Jinja generator, with 15 free browser tools.
Related fixes
Servers
nginx 400: a plain HTTP request reached the HTTPS port
The plain HTTP request was sent to HTTPS port
nginx returns this 400 when a client speaks plain HTTP to a port that is configured for TLS.
2 causes, each with a fixServers
ingress-nginx controller stops working after upgrading Kubernetes to 1.22 or later
ingress-nginx controller does not start after an AKS upgrade to 1.22
Kubernetes 1.22 stopped serving the extensions/v1beta1 and networking.k8s.io/v1beta1 Ingress APIs.
2 causes, each with a fixServers
Kubernetes Ingress returns 404 for a path other than /
404 Not Found nginx on /app but / works
The ingress matches /app, but the backend still receives /app and has no route there, so it answers 404.
3 causes, each with a fixServers
Uploads larger than 1 MB fail with 413 behind the Kubernetes NGINX Ingress controller
Uploads of a few MB fail, small files work
The ingress-nginx controller limits request bodies to 1m by default and answers 413 above that.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fixServers
A cert-manager Certificate stays at READY False with Let's Encrypt
Issuing certificate as Secret does not exist
A Certificate that stays not ready is waiting on a chain: Issuer, CertificateRequest, Order, Challenge.
3 causes, each with a fix