-
Notifications
You must be signed in to change notification settings - Fork 592
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
x-forwarded-for does not set correct ip #60
Comments
Isn't it related to https://kubernetes.io/docs/tutorials/services/source-ip/#source-ip-for-services-with-type-nodeport ? Did you try |
+1 |
This is related to the Kubernetes network configuration. Thank you for opening this issue. |
@hbagdi hi. Is possible to be a bug in kong? I tested today here with nginx-ingress kops addon and displayed correct In both examples I used mendhak/http-https-echo image |
@joubertredrat, try setting
https://docs.konghq.com/1.3.x/configuration/#trusted_ips |
Hello @raittes , i have the same issue with your configuration, I think the proxy does not support modification |
I have the same problem, too. And I think it's important to me, In my Cluster, I will use kong to forward some requests to external services, and these external services will check We add our node ip to this white ip list, so I want to my request |
Hey @Pierre-Malherbe I got this plugin at kong-ingress-controller version: 2.1.x And this is my plugin: kind: KongPlugin
apiVersion: configuration.konghq.com/v1
config:
functions:
- ngx.var.upstream_x_forwarded_for=nil
metadata:
annotations:
global: 'true'
kubernetes.io/ingress.class: kong
name: egress-plugin-remove-x-forwarded-for
plugin: pre-function With this config on pre-function, it will make |
I have the same problem. How was it finally resolved? |
apiVersion: v1
kind: Service
metadata:
annotations:
konghq.com/override: cc # you need this, cc is the name of kongingress
kubernetes.io/ingress.class: kong # ingressController
name: cc
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
k8s-app: cc
qcloud-app: cc
---
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
annotations:
kubernetes.io/ingress.class: kong
name: cc
route:
preserve_host: false # this must be false
upstream:
host_header: cc.isd.com # this is the finally host that client get
---
# ingress yaml detail
# ---
# deployment yaml detail |
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
Kong Ingress controller version:
kong:0.13.1-centos
Kubernetes version (use
kubectl version
):Environment:
uname -a
):What happened:
Can't get the correct x-forwarded-for ip
What you expected to happen:
Set correct x-forwarded-for header for correct ip
How to reproduce it (as minimally and precisely as possible):
access is from browser ( kong have nodePort type service, port 80 on every node )
map a name specified in dummy ingress to the ip of any node
get the following html page
172.28.46.122 is node ip
expect x-forwarded-for be my desktop ip 172.28.66.71
Anything else we need to know:
The text was updated successfully, but these errors were encountered: