<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>If you have used helm to install nginx ingress, you can also look at the rewrite example in the helm chart directory. It can be found at <code>&lt;helm-chart-directory&gt;/examples/rewrite</code>. There should be a README.md which should help.</p>
<p>In my case, the required annotation was <code>nginx.org\rewrite:&quot;&lt;service-name-1&gt;:&lt;rewrite-target-1&gt;;&lt;service-name-2&gt;:&lt;rewrite-target-2&gt;&quot;</code></p>
