<p>After setting TLS succesfully, i'm not able to reach my web application through the ingress, since it is always redirecting to 404 default backend</p>

<p>This is my ingress configuration:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    kubernetes.io/ingress.class: nginx
    certmanager.k8s.io/cluster-issuer: 'letsencrypt-prod'
    nginx.ingress.kubernetes.io/ssl-redirect: 'true'
spec:
  tls:
    - hosts:
        - xxxx.com
        - www.xxxx.com
      secretName: xxxx-com
  rules:
    - host: xxxx.com
    - http:
        paths:
          - path: /(.*)
            backend:
              serviceName: web-cluster-ip-service
              servicePort: 3000
    - host: www.xxxx.com
    - http:
        paths:
          - path: /(.*)
            backend:
              serviceName: web-cluster-ip-service
              servicePort: 3000
</code></pre>

<p>Removing TLS options make it work fine (thought is not using TLS anymore):</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    kubernetes.io/ingress.class: nginx
spec:
  rules:
    - http:
        paths:
          - path: /(.*)
            backend:
              serviceName: web-cluster-ip-service
              servicePort: 3000
</code></pre>

<p>Nevermid, after many hours i found that my configuration has an error:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
    kubernetes.io/ingress.class: nginx
    certmanager.k8s.io/cluster-issuer: 'letsencrypt-prod'
    nginx.ingress.kubernetes.io/ssl-redirect: 'true'
spec:
  tls:
    - hosts:
        - xxxx.com
        - www.xxxx.com
      secretName: xxxx-com
  rules:
    - host: xxxx.com
      http:
        paths:
          - path: /(.*)
            backend:
              serviceName: web-cluster-ip-service
              servicePort: 3000
    - host: www.xxxx.com
      http:
        paths:
          - path: /(.*)
            backend:
              serviceName: web-cluster-ip-service
              servicePort: 3000
</code></pre>

<p>Hypens should be removed before http in each host block</p>

<p>That was... hard to find, a warning message when applying a possible weird/wrong configuration would not have hurt anyone</p>
