<p>I'm trying to use rewrite target from kubernetes with <code>gcloud</code> but it doesn't seem to be respected. My code is the following. Maybe there's something I'm not seen:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: demo-ingress
  annotations:
    ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.global-static-ip-name: projectip
spec:

  rules:
  - host: mycustomdomain.com
    http:
      paths:
      - path: /*
        backend:
          serviceName: frontend
          servicePort: 80
      - path: /api/*
        backend:
          serviceName: backend
          servicePort: 80
</code></pre>

<p>When I do <code>curl mycustomdomain.com/api/something</code> my backend is always receiving <code>backend/api/something</code> instead of <code>backend/something</code>. I'm really out of ideas and I could use some help. </p>

<p>The term <code>rewrite-target</code> is misleading: it is about the path of the <strong>incoming</strong> request.</p>

<p>This might work: use one ingress with <code>rewrite-target: /</code> and <code>path: /</code> for the frontend only, and one ingress with <code>rewrite-target: /api</code> and <code>path: /</code> for the backend only.</p>
