From f600acf2b649596f292293b738f80988f4471b3b Mon Sep 17 00:00:00 2001 From: Piyush Kumar Date: Thu, 22 Aug 2019 21:12:32 +0530 Subject: [PATCH] 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. --- .../docs/tasks/access-application-cluster/ingress-minikube.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/access-application-cluster/ingress-minikube.md b/content/en/docs/tasks/access-application-cluster/ingress-minikube.md index 56cea2a220..123699856b 100644 --- a/content/en/docs/tasks/access-application-cluster/ingress-minikube.md +++ b/content/en/docs/tasks/access-application-cluster/ingress-minikube.md @@ -140,13 +140,13 @@ The following file is an Ingress resource that sends traffic to your Service via metadata: name: example-ingress annotations: - nginx.ingress.kubernetes.io/rewrite-target: / + nginx.ingress.kubernetes.io/rewrite-target: /$1 spec: rules: - host: hello-world.info http: paths: - - path: /* + - path: /(.+) backend: serviceName: web servicePort: 8080