<p>How to creating Rewrite Rules about nginx ingress controller, in the same way as NGINX able to do redirect.</p>

<p>like : (exemple)
server_name www.foo.com;
rewrite  ^/search$     <a href="https://www.foo.com/all/search" rel="nofollow noreferrer">https://www.foo.com/all/search</a>    permanent;</p>

<p>This is supported in the latest (beta.3) version of the ingress controller.</p>

<p>You set it using annotations. Have a look at the example <a href="https://github.com/kubernetes/ingress/tree/master/examples/rewrite/nginx#rewrite-target" rel="nofollow noreferrer">here</a></p>

<p>Essentially, when you set up your ingress, you'll need to specify it like so:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/rewrite-target: /search
  name: rewrite
  namespace: default
spec:
  rules:
  - host: foo.com
    http:
      paths:
      - backend:
          serviceName: my-service
          servicePort: 80
        path: /all/search
</code></pre>
