Skip to content

feat(ingress): migrate nginx annotation proxy_set_header to HAProxy#677

Open
x10an14-nav wants to merge 2 commits into
masterfrom
add_haproxy_ingress_header_mapping_from_nginx
Open

feat(ingress): migrate nginx annotation proxy_set_header to HAProxy#677
x10an14-nav wants to merge 2 commits into
masterfrom
add_haproxy_ingress_header_mapping_from_nginx

Conversation

@x10an14-nav

Copy link
Copy Markdown
Contributor

This preserves request-header behavior for applications relying on nginx.ingress.kubernetes.io/configuration-snippet during ingress migration.

HAProxy header names are case-insensitive, including the req.fhdr(...) lookup we use.
Sources:
- HAProxy docs, HTTP request headers:
  https://docs.haproxy.org/2.8/configuration.html#1.2.2

Quote:
> Contrary to a common misconception, header names are not case-sensitive

Also:
> Internally, all header names are normalized to lower case so that HTTP/1.x and HTTP/2 use the exact same representation
- HAProxy docs, hdr(<name>):
  https://docs.haproxy.org/2.8/configuration.html#4.2-balance

Quote:
> the header name in parenthesis is not case sensitive
- HAProxy source confirms req.fhdr(...) uses http_get_htx_fhdr(...), which calls http_find_header(...).
- http_find_header(...) uses isteqi(n, name) for exact header-name matching.
- isteqi(...) is HAProxy’s case-insensitive string equality function.

Conclusion:
- %[req.fhdr(x-client-ip)]
- %[req.fhdr(X-Client-IP)]
- %[req.fhdr(X-CLIENT-IP)]
all target the same request header name in HAProxy.

@x10an14-nav x10an14-nav requested a review from a team as a code owner May 20, 2026 12:00
This preserves request-header behavior for applications relying on `nginx.ingress.kubernetes.io/configuration-snippet` during ingress migration.

```
HAProxy header names are case-insensitive, including the req.fhdr(...) lookup we use.
Sources:
- HAProxy docs, HTTP request headers:
  https://docs.haproxy.org/2.8/configuration.html#1.2.2

Quote:
> Contrary to a common misconception, header names are not case-sensitive

Also:
> Internally, all header names are normalized to lower case so that HTTP/1.x and HTTP/2 use the exact same representation
- HAProxy docs, hdr(<name>):
  https://docs.haproxy.org/2.8/configuration.html#4.2-balance

Quote:
> the header name in parenthesis is not case sensitive
- HAProxy source confirms req.fhdr(...) uses http_get_htx_fhdr(...), which calls http_find_header(...).
- http_find_header(...) uses isteqi(n, name) for exact header-name matching.
- isteqi(...) is HAProxy’s case-insensitive string equality function.

Conclusion:
- %[req.fhdr(x-client-ip)]
- %[req.fhdr(X-Client-IP)]
- %[req.fhdr(X-CLIENT-IP)]
all target the same request header name in HAProxy.
```
@x10an14-nav x10an14-nav force-pushed the add_haproxy_ingress_header_mapping_from_nginx branch from aa5ec2b to c845e95 Compare May 20, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant