<p>I use Network load balancer which was provisioned using the yaml file I got here: <a href="https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/aws/deploy-tls-termination.yaml" rel="nofollow noreferrer">https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/aws/deploy-tls-termination.yaml</a></p>
<p>I have also pointed my domain to the Network Load balancer created by ingress-nginx.</p>
<p>But whenever I try it to access the site, I get a 502 Bad Gateway error.</p>
<p>Below is a sample of my ingress-nginx resource:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
    # for backend TLS
    nginx.ingress.kubernetes.io/secure-backends: &quot;true&quot;
    nginx.ingress.kubernetes.io/backend-protocol: &quot;HTTPS&quot;
spec:
  rules:
    - host: &quot;my.sub.domain.com&quot;
      http:
        paths:
          - pathType: Prefix
            path: /
            backend:
              service:
                name: apigateway
                port:
                  number: 1234
</code></pre>
<p>Please what can I do to solve the issue? I have searched the internet for days now. Thank you.</p>

Fhuad Balogun
<p>i would suggest try checking out the</p>
<p>The annotation <code>nginx.ingress.kubernetes.io/ssl-passthrough</code> instructs the controller to send <strong>TLS</strong> connections directly to the backend instead of letting <strong>NGINX</strong> decrypt the communication.</p>
<p>You should also check out the</p>
<pre><code>nginx.ingress.kubernetes.io/configuration-snippet: |
      proxy_ssl_name &quot;svc-s.default.svc.cluster.local&quot;;
</code></pre>
<p>Reference doc : <a href="https://github.com/kubernetes/ingress-nginx/issues/4928#issuecomment-574331462" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/4928#issuecomment-574331462</a></p>
<p>Hope your service is running, as Nginx only throws the 502 when there is the issue of backend or upstream service not running.</p>
