Report this

What is the reason for this report?

How to get original request IP when using Cilium Gateway API on DOKS?

Posted on December 26, 2025

I’ve a simple setup with a Cilium Gateway on DOKS, with a few HTTPRoutes setup pointing to some pods running NodeJS apps. Everything is working perfectly except I’m unable to retrieve the original request IP, which I need for request logging.

According to the documentation I should be able to retrieve the original IP from the x-forwarded-for header. This header only contains a single private IP, other headers don’t contain the IP address either.

Did anyone succeed to retrieve the original IP from a request? How did you do it?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

I might be wrong, but this usually comes down to how traffic enters a DOKS cluster, not a Cilium or Gateway API issue.

By default, DigitalOcean load balancers do not preserve the client source IP. What reaches your Gateway is the node or proxy IP, which is why x-forwarded-for only contains a private address.

In practice, you have two options:

  • Rely on X-Forwarded-For, but only if the load balancer is terminating HTTP(S) and adding it correctly.

  • Enable PROXY protocol on the DigitalOcean load balancer and make sure your Cilium Gateway supports and parses it.

If PROXY protocol isn’t enabled or supported in your setup, you won’t be able to see the real client IP. I’d double-check the load balancer configuration and Cilium version, and if it’s still not working, opening a support ticket is probably the best way to confirm what’s supported today:

https://www.digitalocean.com/support/

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.