<p>I have a react web application listening on the default path and I'm looking to include my API backend on the same URL.</p>

<p>A snippet of my ingress is below: </p>

<pre><code>    http:
      paths:
      - backend:
          serviceName: atsweb
          servicePort: 80
        path: /(.*)
      - backend:
          serviceName: atsapi
          servicePort: 80
        path: /api(/|$)(.*)
</code></pre>

<p>My API has a bunch of functions which are routed after /api/ and I have a test page at mydomain.io/api/values which I cannot get to. My frontend service works fine. </p>

<p>Is it just the pathing which is incorrect?</p>

<p>I've deployed a standalone API just to check the container port/service ports are correct. </p>

Koxzi
<p>Looks like you copied the example from <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer"></a>. What are your ingress annotations? Check the rewrite as it looks like is making a redirect. Nonetheless, the ingress that would work for looks like this:</p>

<pre><code>---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: your-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
  rules:
  - http:
      paths:
      - path: /
        backend:
          serviceName: atsweb
          servicePort: 80
      - path: /api/
        backend:
          serviceName: atsapi
          servicePort: 80
</code></pre>

<p>Check there is no rewrite annotation. This makes your uri be appended fully to the next proxy. Thus, making <code>mydomain.io/api/values</code> go to <code>atsapi:80/api/values</code> </p>
