Skip to content

Commit f600acf

Browse files
piyushkumar13k8s-ci-robot
authored andcommitted
Starting from nginx ingress controller Version 0.22.0 onwards, it uses placeholders /$1 or /$2 soon for rewrite-target annotation (#15504)
In nginx ingress controller Version 0.22.0 and beyond, any substrings within the request URI that need to be passed to the rewritten path must explicitly be defined in a capture group. Please refer doc here : * `https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite-target` * `https://stackoverflow.com/a/55193468/5527839 ` Currently, what was mentioned in the docs, didnt work for me. I was using minikube version `1.2.0` which uses ingress above v0.21.0. After reading the docs provided in above two links, was able to figure out where it was lacking. Have mentioned the changes in the proposed file change.
1 parent ef918bc commit f600acf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/en/docs/tasks/access-application-cluster/ingress-minikube.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,13 @@ The following file is an Ingress resource that sends traffic to your Service via
140140
metadata:
141141
name: example-ingress
142142
annotations:
143-
nginx.ingress.kubernetes.io/rewrite-target: /
143+
nginx.ingress.kubernetes.io/rewrite-target: /$1
144144
spec:
145145
rules:
146146
- host: hello-world.info
147147
http:
148148
paths:
149-
- path: /*
149+
- path: /(.+)
150150
backend:
151151
serviceName: web
152152
servicePort: 8080

0 commit comments

Comments
 (0)