This patches the ingress-nginx controller to use case sensitive path prefix matching.
My issue in the repo was ignored kubernetes/ingress-nginx#7010
This patches the ingress-nginx controller to use case sensitive path prefix matching.
My issue in the repo was ignored kubernetes/ingress-nginx#7010
FROM registry.k8s.io/ingress-nginx/controller:v1.5.1@sha256:4ba73c697770664c1e00e9f968de14e08f606ff961c76e5d7033a4a9c593c629 | |
ADD nginx.tmpl.patch ./template/nginx.tmpl.patch | |
RUN patch -p0 -i ./template/nginx.tmpl.patch |
--- template/nginx.tmpl.orig 2023-01-26 19:02:15.878440041 -0500 | |
+++ template/nginx.tmpl 2023-01-26 19:05:44.424283923 -0500 | |
@@ -1183,7 +1183,12 @@ | |
{{ end }} | |
{{ end }} | |
+ # replace case insensitive with case sensitive | |
+ {{ if hasPrefix $path "~*" }} | |
+ location ~ {{ slice $path 2 }} { | |
+ {{ else }} | |
location {{ $path }} { | |
+ {{ end }} | |
{{ $ing := (getIngressInformation $location.Ingress $server.Hostname $location.IngressPath) }} | |
set $namespace {{ $ing.Namespace | quote}}; | |
set $ingress_name {{ $ing.Rule | quote }}; |