-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
forwarded-for-header uneffectful on GKE w/o specifying externalTrafficPolicy #4401
Comments
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Why should I be responsible for bumping your issues? If you want to keep issues unresolved, please do close them without acting on them. |
/remove-lifecycle stale |
I am also having this problem and I think it would be a nice feature. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Updating the config to I'm using nginx-ingress instead of ingress-nginx, but I believe the underlying issue is the same. |
TL;DR the Helm chart for ingress-nginx should set
externalTrafficPolicy: "Local"
to enable source IP capture withX-Forwarded-For
andX-Real-IP
.Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.): No
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.): forwarded headers, x-forwarded-for
Is this a BUG REPORT or FEATURE REQUEST? (choose one): bug
NGINX Ingress controller version: https://hub.helm.sh/charts/stable/nginx-ingress/1.12.1
Kubernetes version (use
kubectl version
):Environment:
uname -a
): noneWhat happened:
I was expecting this config map:
To change the seen
X-Forwarded-For
header to be that ofCf-Connecting-Ip
but it does not.EDIT: setting
proxy-real-ip-cidr: "0.0.0.0/0"
makes it all work; but is insecure. This is because$remote_addr
is taken to be10.0.3.206
, i.e. k8s-internal IP, despite the nginx controller service resource having this runtime state due to this: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ipWhat you expected to happen:
How to reproduce it (as minimally and precisely as possible):
New nginx ingress, set up cloudflare proxy in front, https via let's encrypt on both, then the above configmap.
Anything else we need to know:
Full repro config:
The text was updated successfully, but these errors were encountered: