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

The obnoxious 502 Error

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”

Adding an Annotation for the new version

…and that was it, everything worked perfect afterwards!

--

--

Akriotis Kyriakos

talking about: kubernetes, golang, open telekom cloud, aws, openstack, sustainability, software carbon emissions