<p>I have an ingress controller with two services running behind it. I also have an SSL certificate installed with Lets Encrypt and cert-manager.</p>
<p>For some reason, whenever i make a request to my endpoints, it returns a 404 not found error. For example</p>
<pre><code>http://stefandeboer.com/api/neume-billing-service/Transaction
</code></pre>
<p>returns</p>
<pre><code>&lt;html&gt;

&lt;head&gt;
    &lt;title&gt;404 Not Found&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
    &lt;center&gt;
        &lt;h1&gt;404 Not Found&lt;/h1&gt;
    &lt;/center&gt;
    &lt;hr&gt;
    &lt;center&gt;nginx&lt;/center&gt;
&lt;/body&gt;

&lt;/html&gt;
</code></pre>
<p>This is the YAML for my ingress:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
  creationTimestamp: &quot;2023-06-05T22:51:36Z&quot;
  generation: 3
  name: neume-ingress
  namespace: default
  resourceVersion: &quot;1888643&quot;
  uid: 9abf4d0f-3370-4856-b3e2-c555c7042739
spec:
  rules:
  - host: stefandeboer.com
  - http:
      paths:
      - backend:
          service:
            name: neume-user-service
            port:
              number: 80
        path: /api/neume-user-service(/|$)(.*)
        pathType: Prefix
      - backend:
          service:
            name: neume-billing-service
            port:
              number: 80
        path: /api/neume-billing-service(/|$)(.*)
        pathType: Prefix
  tls:
  - hosts:
    - stefandeboer.com
    secretName: tls-secret
status:
  loadBalancer:
    ingress:
    - ip: 20.4.165.91
</code></pre>
<p>Both my pods are running in the same namespace:</p>
<pre><code>NAME                                                READY   STATUS    RESTARTS   AGE
neume-billing-service-deployment-769ff6487b-sjk5d   1/1     Running   0          31m
neume-user-service-deployment-5674b4b75d-8zhgp      1/1     Running   0          29m
</code></pre>
<p>What could i be doing wrong here?</p>

stefan de boer
<p>its looks like that you have miss configuration on your ingress, the host declaration must be part of the same object as the HTTP declaration.</p>
<p>instead of:</p>
<pre><code>  rules:
  - host: stefandeboer.com
  - http:
</code></pre>
<p>you need to do it like this:</p>
<pre><code>   rules:
   - host: stefandeboer.com
     http:
</code></pre>
