<p>I am trying to use ingress-nginx to implement nginx's proxy_pass specified with a URI to distribute different requests to different backend services. How do I configure it?</p>

<p>The version of ingress-nginx I am using is 0.22. I tried using the nginx.ingress.kubernetes.io/rewrite-target annotation, but it is not the effect I want.</p>

<p>I want to use ingress-nginx to implement the following nginx configuration, the proxy_pass directive is specified with a URI: </p>

<pre><code>location /asset/api {
    proxy_pass http://asset_api/;
}
</code></pre>

xudahuo
<p>My fault, using nginx.ingress.kubernetes.io/rewrite-target can achieve the above functions:</p>

<p>Routing: </p>

<pre><code>example.com/asset/web/(.*)
</code></pre>

<p>Then use the ingress annotation feature:</p>

<pre><code>nginx.ingress.kubernetes.io/rewrite-target: '$1'
</code></pre>
