- March 14, 2024
- 1 min read
Fixing error 'ERR_TOO_MANY_REDIRECTS' when using HAProxy with ArgoCD
When you use HAProxy Ingress with ArgoCD on Kubernetes you are going to run into this error 'ERR_TOO_MANY_REDIRECTS' when you browse to the ArgoCD server URL. I lost of few hours trying to figure out what the cause is and wanted to write this up with the hope that it saves some one else time later and also a note for myself so I don't forget exactly what I did to solve the issue.
I installed ArgoCD server on my EKS cluster following the instructions in the ArgoCD docs using the command below
kubectcl create namespace gitops
kubectl apply -n gitops -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/install.yamlAfter that I created an Ingress Resource by running the command below
cat <<EOF | kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd
namespace: gitops
spec:
ingressClassName: haproxy
rules:
- host: gitops.sandbox2841.opentlc.com
http:
paths:
- backend:
service:
name: argocd-server
port:
name: https
path: /
pathType: Prefix
tls:
- hosts:
- gitops.sandbox2841.opentlc.com
EOFBrowse to https://gitops.sandbox2841.opentlc.com and started noticing 'ERR_TOO_MANY_REDIRECTS'. reason why this was happening is because HAProxy by default terminates SSL and forwards HTTP to backend service and ArgoCD server when it sees an HTTP traffic it automatically redirects to HTTPS. This results in an infinite loop and eventually HAProxy gives up and you see that error in browser.
So to fix this problem I simply had to add an annotation ingress.kubernetes.io/ssl-passthrough: "true" to the ingress resource so HAProxy instead of terminating HTTPS traffic at the proxy will do an SNI passthrough.
Updated Ingress resource as shown below
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd
namespace: gitops
annotations:
ingress.kubernetes.io/ssl-passthrough: "true"
spec:
ingressClassName: haproxy
rules:
- host: gitops.sandbox2841.opentlc.com
http:
paths:
- backend:
service:
name: argocd-server
port:
name: https
path: /
pathType: Prefix
tls:
- hosts:
- gitops.sandbox2841.opentlc.com
EOFGrab the admin password from kubernetes secret by running command below
kubectl get secrets argocd-initial-admin-secret -n gitops -o jsonpath="{.data.password}" | base64 -d | pbcopyBrowse to https://gitops.sandbox2841.opentlc.com enter admin for username and paste the password obtained from previous step and you will be logged into ArgoCD server successfully as shown in screen capture below

Hope this helps,
Thanks,
Ram
Related Posts
RAM GOPINATHAN
August 12, 2026
Building Kubernetes-Style APIs: A Practical Walkthrough
Kubernetes real innovation is the declarative, self-healing API pattern. This post builds that pattern from scratch: an OpenAPI-first server, a Postgres-backed store instead of etcd, and a clean service/store split that keeps business logic out of the database
RAM GOPINATHAN
February 28, 2026
Automating post install configurations with cloud-init for Red Hat Enterprise Linux deployments on baremetal environments
Stop configuring servers by hand. Here's how cloud-init brings cloud-level automation to your physical infrastructure.
RAM GOPINATHAN
January 22, 2026
PODMAN TIPS: Implementing init container pattern for containers running on PODMAN
If you’ve worked with Kubernetes, you’re probably familiar with init containers—containers that run before the main application and are typically used for setup or initialization tasks. In this post,…