<p>I have a K8s setup with traefik being exposed like this</p>
<pre><code>kubernetes:
  ingressClass: traefik
service:
  nodePorts:
    http: 32080
serviceType: NodePort
</code></pre>
<p>Behind, I forward some requests to different services</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-name
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
    - host: my-host.com
      http:
        paths:
          - path: /my-first-path
            backend:
              serviceName: my-nodeJs-services
              servicePort: 3000
</code></pre>
<p>When the DNS is set directly to resolve to my ip, the application works fine with HTTP</p>
<p><a href="http://my-host.com:32080/my-first-path" rel="nofollow noreferrer">http://my-host.com:32080/my-first-path</a></p>
<p>But when some one add SSL through AWS ALB / API Gateway, the application fail to be reached with 404-NotFound error</p>
<p>The route is like this
<a href="https://my-host.com/my-first-path" rel="nofollow noreferrer">https://my-host.com/my-first-path</a></p>
<p>On the AWS size, they configured something like this</p>
<pre><code>https://my-host.com =&gt; SSL Termination and  =&gt; Forward all to 43.43.43.43:32080
</code></pre>
<p>I think this fail because traefik is expecting <a href="http://my-host.com" rel="nofollow noreferrer">http://my-host.com</a> but not <a href="https://my-host.com" rel="nofollow noreferrer">https://my-host.com</a> which lead to its failure to find the matching route? Or maybe at the ssl termination time, the hostname is lost so that traefik can not find a route?</p>
<p>What should I do in this situation?</p>

qkhanhpro
<p>I am not very familiar with ALB but what is probably happening is that the requests received by the loadbalancer contain the header <code>Host: my-host.com</code> and when it gets forwarded to your ingress controller, the header is replaced by <code>Host: 43.43.43.43</code>. If this is the case, I see 3 solutions:</p>
<ol>
<li>ALB might be able to pass the original Host header to the target. (You will have to check in the doc if it's possible)</li>
<li>If the application behind your ingress doesn't check the host header, you can write an ingress that doesn't check a specific host. For example on these <a href="https://doc.traefik.io/traefik/v1.7/user-guide/kubernetes/#traffic-splitting" rel="nofollow noreferrer">examples</a> you can see that the host field is not specified.</li>
<li>If the name resolution works internally, you can define a name for your target, use this name in your ALB and in your ingress.</li>
</ol>
