How to configure nginx.ingress.kubernetes.io/rewrite-target and spec.rules.http.paths.path to satisfy the following URI patterns

后端 未结 2 2003
礼貌的吻别
礼貌的吻别 2021-02-10 09:43

How can I configure nginx.ingress.kubernetes.io/rewrite-target and spec.rules.http.paths.path to satisfy the following URI patterns?

/a         


        
2条回答
  •  情书的邮戳
    2021-02-10 10:27

    Came up with the following configuration - it is working for all of my test routes / requirements so far.

    The regex is almost the same as the one posted by @Gilgames.

    I based mine on the official docs rewrite example: https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite-target

    Apart from that I took a quick course at https://www.regular-expressions.info/

提交回复
热议问题