haproxy-ingress
haproxy-ingress copied to clipboard
X-Forwarded-For header missing
Description of the problem X-Forwarded-For header not working tried ignore and ifmissing and in both cases I end up with the same haproxy.cfg:
backend
...
http-request set-header X-Original-Forwarded-For %[hdr(x-forwarded-for)] if { hdr(x-forwarded-for) -m found }
http-request del-header x-forwarded-for
option forwardfor
I am worried of http-request del-header x-forwarded-for
, the backend is not receiving the header.
Expected behavior
x-forwarded-for header correctly set
Steps to reproduce the problem
Annotate:
ingress.kubernetes.io/forwardfor: ifmissing
or
ingress.kubernetes.io/forwardfor: ignore
Environment information
HAProxy Ingress version: v0.14.5
Command-line options:
(paste command-line options here)
Global options:
bind-http: xxxx:80
bind-https: xxxx:443
default-ssl-certificate: haproxy/cert
healthz-port: "10253"
nbthread: "7"
reload-strategy: reusesocket
ssl-redirect: "true"
stats-port: "1936"
syslog-endpoint: xxxx:514
syslog-tag: haproxy
use-htx: "true"
watch-ingress-without-class: "true"
Ingress objects:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/forwardfor: ifmissing
...
This issue got stale and will be closed in 7 days.
Hi, how did you make this test? I cannot reproduce it, and just added an integration test that explores this functionality on #1115
Note that the option forwardfor
configuration is the one that adds the XFF
header, so it seems that your generated haproxy.cfg file is right.
This issue got stale and will be closed in 7 days.