502-Bad Gateway Nginx Ingress error in Rancher for an ASP.NET Core application
HTTPS-Backend Ingress Problem when accessing an ASP.NET Core application hosted in Rancher
I literally lost about a week trying to figure out why my ingress sitting in front of an ASP.NET Core App deployed in Rancher was always returning 502 Bad Gateway.
After endless googling, reading books and articles, even setting up a bare metal K8S to compare the different behaviours, I finally found the answer dug somewhere deep in a Rancher forum:
Add to your ingress, if it’s the new version, the following Annotation :
nginx.ingress.kubernetes.io/backend-protocol: “HTTPS”
or alternatively if it”s the old version:
nginx.ingress.kubernetes.io/secure-backends: “true”
…and that was it, everything worked perfect afterwards!