<p>I've the following ingress configuration but when I call <code>www.domain.com/api</code> it always open my UI service instead of API and the same thing happens if I call something else after <strong>api</strong>, for example <code>www.domain.com/api/v1/projects</code>.</p>

<p>How can I fix that?</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress
spec:
  tls:
  - secretName: tls
  backend:
    serviceName: ui
    servicePort: 5003
  rules:
  - host: www.domain.com
    http:
      paths:
      - path: /
        backend:
          serviceName: ui
          servicePort: 5003
      - path: /api
        backend:
          serviceName: api
          servicePort: 5000
</code></pre>

<p>Here is the way I fixed this problem. I hope this can help others.</p>

<p>Thanks @aleks!!</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: kronus
spec:
  tls:
  - secretName: tls
  backend:
    serviceName: ui
    servicePort: 5003
  rules:
  - host: domain.com
    http:
      paths:
      - path: /api
        backend:
          serviceName: api
          servicePort: 5000
      - path: /api/*
        backend:
          serviceName: api
          servicePort: 5000
  - host: www.domain.com
    http:
      paths:
      - path: /api
        backend:
          serviceName: api
          servicePort: 5000
      - path: /api/*
        backend:
          serviceName: api
          servicePort: 5000
</code></pre>
