<p>I have this nginx ingress controller:</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
    kubernetes.io/ingress.allow-http: &quot;true&quot;
    nginx.ingress.kubernetes.io/enable-cors: &quot;true&quot;
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
    nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;false&quot;
    # Limit uploads to 8TB
    nginx.ingress.kubernetes.io/proxy-body-size: 800000m
spec:
  rules:
  - host: myhost.info
    http:
      paths:
      # NOTE: this one should come after all other routes. To avoid hijacking requests.
      - path: /api/walrus(/|$)(.*)
        backend:
          serviceName: service-a
          servicePort: 8080
      - path: /api(/|$)(.*)
        backend:
          serviceName: service-b
          servicePort: 8080
      - path: /(.*)
        backend:
          serviceName: frontend
          servicePort: 8080
  - http:
      paths:
      # NOTE: this one should come after all other routes. To avoid hijacking requests.
      - path: /api/walrus(/|$)(.*)
        backend:
          serviceName: service-a
          servicePort: 8080
      - path: /api(/|$)(.*)
        backend:
          serviceName: service-b
          servicePort: 8080
      - path: /(.*)
        backend:
          serviceName: frontend
          servicePort: 8080
</code></pre>
<p>I duplicated the paths just make it clear. My question is, what is the difference in the end result when I add the <code>host</code> key vs when I don't?</p>
<p>Until now I've used it because if I don't have it I'm getting my POST request redirected into get request as in this question: <a href="https://stackoverflow.com/questions/56177198/kubernetes-nginx-ingress-changes-http-request-from-a-post-to-a-get">Kubernetes NGINX Ingress changes HTTP request from a POST to a GET</a></p>
<p>But I also noticed that on EKS, if I DO add a host, the ingress just returns 404 for everything until I remove it and leavit only with http. So I'm a bit confused on this and wanted someone to clarify the correct way to do things here.</p>
<p>Also, for a production enviroment, how do I set the host correctly to a public domain and how do I set the tls certificates?</p>

Pablo Estrada
<p>Regarding HTTPS: <a href="https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/#bGA9CAkdlMh" rel="nofollow noreferrer">https://aws.amazon.com/blogs/opensource/network-load-balancer-nginx-ingress-controller-eks/#bGA9CAkdlMh</a> has a section &quot;Defining the Ingress resource (with SSL termination) to route traffic to the services created above&quot; that shows how to terminate TLS at nginx-ingress. Even if you're not using an AWS Network Load Balancer (NLB), that may be helpful. In the case of AWS with an NLB, you have another option, terminating at the NLB: <a href="https://aws.amazon.com/blogs/aws/new-tls-termination-for-network-load-balancers/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/aws/new-tls-termination-for-network-load-balancers/</a></p>
<p>There are two nginx ingress controllers, and it's unclear which one you're using. The <a href="https://github.com/nginxinc/kubernetes-ingress" rel="nofollow noreferrer">nginxinc controller</a> requires a 'host'. The other, <a href="https://github.com/kubernetes/ingress-nginx" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx</a>, I'm not sure about. When you use TLS, nginx uses SNI for HTTPS, which seems like it would require a 'host': <a href="http://nginx.org/en/docs/http/configuring_https_servers.html#sni" rel="nofollow noreferrer">http://nginx.org/en/docs/http/configuring_https_servers.html#sni</a></p>
