Usually ingress rewrite target works as follows:
nginx.ingress.kubernetes.io/rewrite-target: /
This will rewrite the target of your service names as they are in the root directory. So if I have this:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: demo-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
tls:
rules:
http:
paths:
- path: /
backend:
serviceName: front-main
servicePort: 80
- path: /api
backend:
serviceName: back-main
servicePort: 80
My services are going to receive data as they are in /
. However, I would like for my service front-main
to send root /
and for the server back-main
to send /someotherpath/
. How can I do this?
Is there something like the following line?
nginx.ingress.kubernetes.io/rewrite-target: "front-main: / ; back-main: /someotherpath"
I don't seem to find the answer in the documentation.