Get the client Ip behind a loadbalancer

Hi,
i'm trying to get the client Ip address behind a loadbalancer, i read that i need to configure my web server software to use the XFF header
here.

where can i do that?
i have my load balancer cluster and another cluster with my nodes

thanx

3 Replies

The X-Forwarded-For (XFF) HTTP header field is a setting to configure through the web server. The web server is the service that serves your site from the backend node. The most common are Apache and NGINX.
I did a quick Google search and found these pieces of documentation that should help:

Apache:
Apache Module mod_remoteip
Apache and X-Forwarded-For Header (XFF)

NGINX:
Using the Forwarded header
NGINX and X-Forwarded-For Header (XFF)

Hi @watrick
i don't really understand how i will configure nginx for API services to get the client Ip, is there anything i need to do on the load balancer dashboard,
i tried to read the x-forward-for , it is returning a weird Ip address that is based in UK (where my cluster is located) but i'm sending request (as a client) from another country far away from UK
please help

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct