1

I am trying to forward the X-Forwarded-For header containing the IP address of the client to the backend services but it seems Kong does not allow that to happen, I can read the IP address of the client when I log them in Kong logs, however, every attempt to add X-Forwarded-For header into the request to backend has failed, anyone know why that is?

I have this in my kong configuration file

trusted_ips = 0.0.0.0/0,::/0
real_ip_header = X-Forwarded-For
Serene
  • 11
  • 1
  • 4
  • Does this help https://nginx.org/en/docs/http/ngx_http_realip_module.html and https://discuss.konghq.com/t/how-to-forward-clients-request-ip/384/2 ? – Ôrel May 18 '21 at 21:07
  • How do you check that the header is not set ? – Ôrel May 18 '21 at 21:41
  • Kong is behaving as if there are no trusted ips, even though you set trusted_ips to "all ips". I have noticed similar behavior and I don't understand this. – LeslieK Jul 30 '21 at 18:36
  • Make sure you add your settings to kong.conf running on your data plane (proxy node). If you configure kong.conf on your control plane (admin node), they will have no affect. – LeslieK Jul 30 '21 at 21:02

0 Answers0