<p>I have an ingress service where I can curl to &quot;/&quot; to the UI of the project, but everything but the slash is not routing properly. Below is my last ingress service I tried.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    meta.helm.sh/release-name: ingress
    meta.helm.sh/release-namespace: default
  creationTimestamp: &quot;2022-11-26T15:57:15Z&quot;
  generation: 1
  labels:
    app.kubernetes.io/managed-by: Helm
  name: ingress-service
  namespace: default
  resourceVersion: &quot;53584&quot;
  uid: fccbcc20-e365-42cd-be29-0fff80611ddc
spec:
  rules:
  - host: project.k8s.com
    http:
      paths:
      - backend:
          service:
            name: project-backend
            port:
              number: 8080
        path: /api/
        pathType: Prefix
      - backend:
          service:
            name: project-backend
            port:
              number: 8080
        path: /api/general/details/
        pathType: Prefix
      - backend:
          service:
            name: project-backend
            port:
              number: 8080
        path: /api/general/
        pathType: Prefix
      - backend:
          service:
            name: project-ui
            port:
              number: 8080
        path: /
        pathType: Prefix
status:
  loadBalancer:
    ingress:
    - ip: xxx.xxx.xx.x
</code></pre>
<p>The curls I try</p>
<pre><code>curl http://xx.xxx.xxx.xx/api/general/detail -H &quot;Host: project.k8s.com&quot;

{&quot;timestamp&quot;:&quot;2022-11-27T14:29:31.899+00:00&quot;,&quot;status&quot;:404,&quot;error&quot;:&quot;Not Found&quot;,&quot;path&quot;:&quot;/api/general/detail&quot;}

curl http://xx.xxx.xxx.xx/ -H &quot;Host: project.k8s.com&quot; &lt;-- The UI as expected
</code></pre>
<p>In the Spring logs I read</p>
<pre><code>Tomcat started on port(s): 8080 (http) with context path '/api'
</code></pre>
<p>Which makes me think that the backend service is working correctly and in the ingress logs I see the requests being made. It is a simple backend with a controller with @RequestMapping(&quot;api/general/detail/&quot;) which I tested outside the cluster.</p>
<p>Am I correct? Is the backend service working correctly? Is there anything else to do than looking at the logs / output of the ingress yaml / k get all ?</p>

furion2000
<p>I'm not sure, but what I use for my project with Java backend:</p>
<pre><code>- path: /api/()(.*)
  pathType: ImplementationSpecific
  backend:
    service:
      name: project-backend
      port:
        number: 8080
</code></pre>
<p>Also the problem can be with Java server. It can return 404 if you don't pass necessary params. (content-type or query param)</p>
