title: EKS ingress-nginx and NLB with https redirect
body: <p>I'm having issues with the nlb lately, it was quite an adventure to have nlb with https termination on the lb working with a redirection http=&gt;https and an ingress-nginx on EKS.</p>
  <p>Now, I want to have the X-Forwarded headers passed to the pod, but that breaks the http=&gt;https redirection, I get a 400 on http requests.</p>
  <p>On the service, I tried to put the service with http or tcp protocol, same thing.</p>
  <p>Adding the <code>service.beta.kubernetes.io/aws-load-balancer-proxy-protocol: &quot;*&quot;</code> header to the service, activates the proxy protocol v2 on all targets, and activating <code>use-proxy-protocol: 'true'</code> in the configmap for nginx breaks the http-snippet with the 308 redirection:</p>
  <pre><code>http-snippet: |
      server {
        listen 2443;
        return 308 https://$host$request_uri;
      }
  </code></pre>
  <p>Does anyone has a way to make it so that it can use the nlb with all the good header and the redirect working?</p>
  <p><strong>EDIT</strong> at comment request adding full working config</p>
  <pre><code>apiVersion: v1
  kind: ConfigMap
  metadata:
    labels:
      app.kubernetes.io/version: 0.41.0
      app.kubernetes.io/component: controller
    name: ingress-nginx-controller
  data:
    http-snippet: |
      server {
        listen 2443 proxy_protocol;
        return 308 https://$host$request_uri;
      }
    proxy-real-ip-cidr: 10.4.0.0/16
    use-forwarded-headers: 'true'
    use-proxy-protocol: 'true'
    compute-full-forwarded-for: 'true'
  </code></pre>