-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Case *sensitive* path matching #7010
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
For anyone who needs this, I made the following patch: --- nginx.tmpl.orig 2020-05-12 13:18:43.000000000 -0400
+++ nginx.tmpl 2021-09-21 16:18:40.346643696 -0400
@@ -1015,7 +1015,12 @@
}
{{ 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.Path) }}
set $namespace {{ $ing.Namespace | quote}};
set $ingress_name {{ $ing.Rule | quote }}; You can produce a new nginx.tmpl by applying the patch and mount it into the docker container over the existing file. Clearly it's possible to add this as an option, but I have no clue how to build this container so this was easiest for me. |
It would be nice to have an option to enable case sensitive path matching as opposed to case insensitive path matching, perhaps globally. In-fact, the current kubernetes spec (and indeed since v1.18) seems to suggest "Prefix" path type would be case sensitive.
From: https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types
Very explicitly:
An ingress with the path:
/MyWebsite
should not match the url/mywebsite
.What's the use-case for this you might ask? We have a catch-all provider which corrects misspellings (which would include casing issues); but it can't work if
/MyWebsite
gets sent to/mywebsite
. Some case sensitive backends like tomcat will show a 404 instead of the site at/mywebsite
.No issue found.
I don't believe it should require a particular version, though if the goal is to match the spec I guess it'd be v1.18+
If there is a way to do this, or i'm just mistaken; it would be helpful to document it explicitly. A search for
case
,sensitivity
, orstrict
on the docs turns up nothing./kind feature
The text was updated successfully, but these errors were encountered: