<p>So I have a bunch of services running in a cluster, all exposed via <code>HTTP</code> only ingress object, example:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
  name: some-ingress
spec:
  ingressClassName: nginx
  rules:
  - http:
      paths:
      - backend:
          service:
            name: some-svc
            port:
              number: 80
        path: /some-svc(/|$)(.*)
        pathType: Prefix
</code></pre>
<p>They are accessed by <code>http://&lt;CLUSTER_EXTERNAL_IP&gt;/some-svc</code>, and it works ofc.</p>
<p>Now I want to create an additional ingress object for every service which will force <code>SSL</code> connections and allow the use of a domain instead of an IP address.</p>
<p>The problem is that the newer <code>SSL</code> ingresses always return <code>404</code> while testing the connection.</p>
<p>The manifests are as follows:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: &quot;some-ingress-ssl&quot;
  annotations:
    ingress.kubernetes.io/ssl-redirect: &quot;true&quot;
    ingress.kubernetes.io/app-root: &quot;/some-svc&quot;
spec:
  tls:
  - hosts:
      - foobar.com
    secretName: foobar-tls
  rules:
  - host: foobar.com
    http:
      paths:
      - path: /some-svc(/|$)(.*)
        pathType: Prefix
        backend:
          service:
            name: some-svc
            port:
              number: 80
</code></pre>
<p>tests (foobar.com point to CLUSTER_EXTERNAL_IP):</p>
<pre><code>&gt; curl -I http://&lt;CLUSTER_EXTERNAL_IP&gt;/some-svc
HTTP/1.1 200 OK
&gt; curl -I https://foobar.com/some-svc
HTTP/2 404
</code></pre>
<p>Is it possible to have both ingresses simultaneously? (one enforcing <code>SSL</code>, the other not)
If so what am I doing wrong here?</p>

wiktor
<p>Figured out I was missing this annotation:</p>
<pre><code>nginx.ingress.kubernetes.io/rewrite-target: /$2
</code></pre>
<p>in <code>SSL</code> ingress...</p>
<p>works like a charm now, maybe someone will find this usefull</p>
