Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions documentation/doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,14 @@ image_arguments:
version_min: "3.2"
values:
- Boolean value, just need to declare the flag
- argument: --case-insensitive-path-match
description: |-
Enable case-insensitive path matching for Ingress resources.
By default, path matching is case-sensitive. If enabled, HAProxy will perform case-insensitive matching for all Ingress paths.
example: --case-insensitive-path-match
version_min: "3.2"
values:
- Boolean value, just need to declare the flag to enable
groups:
config-snippet:
header: |-
Expand Down
8 changes: 7 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,12 @@ func (c *HAProxyController) setupHAProxyRules() error {
ForwardedProto: true,
}, false),
)

pathExpr := "path"
if c.osArgs.CaseInsensitive {
pathExpr = "path,lower"
}

for _, frontend := range []string{c.haproxy.FrontHTTP, c.haproxy.FrontHTTPS} {
errs.Add(
// txn.base var used for logging
Expand All @@ -300,7 +306,7 @@ func (c *HAProxyController) setupHAProxyRules() error {
c.haproxy.AddRule(frontend, rules.ReqSetVar{
Name: "path",
Scope: "txn",
Expression: "path",
Expression: pathExpr,
}, false),
c.haproxy.AddRule(frontend, rules.ReqSetVar{
Name: "host",
Expand Down
1 change: 1 addition & 0 deletions pkg/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,5 @@ type OSArgs struct {
DisableIngressStatusUpdate bool `long:"disable-ingress-status-update" description:"If true, disables updating the status field of Ingress resources"`
EnableCustomAnnotationsOnIngress bool `long:"enable-custom-annotations-on-ingress" description:"allow custom user annotations on ingress"`
CustomValidationRules NamespaceValue `long:"custom-validation-rules" description:"custom validation rules object" default:""`
CaseInsensitive bool `long:"case-insensitive-path-match" description:"enable case-insensitive path matching"`
}
Loading