How to creating Rewrite Rules about nginx ingress controller, in the same way as NGINX able to do redirect.
like : (exemple) server_name www.foo.com; rewrite ^/search$ https://www.foo.com/all/search permanent;
This is supported in the latest (beta.3) version of the ingress controller.
You set it using annotations. Have a look at the example here
Essentially, when you set up your ingress, you'll need to specify it like so:
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