I want to attach client IP to custom-header via kong-custom-plugin and send it to backe-end.
I tried several ways but could not get the actual Client IP.
Is there a way to know the actual client IP in the kong plugin or the back-end behind kong?
- Openstack VM
- Kong(1.3.0) with DB(postgresql) and Ingress(0.5.0)
- stable chart
cluster ip = 10.221.xx.xx
pod ip = 10.220.1.XX
real client ip = 10.25X.XX.XX
I found that request send client IP to back-end by “X-Forwarded-For” header.
However, X-Forwarded-For is a header value attached by ELB, and nginx and kong are simply forwarded.
real_ip_header = X-Forwarded-For
real_ip_recursive = on
trusted_ips = 0.0.0.0/0,::/0