Score:0

Obtain real Ip from NGINX which is receiving from external L4 load balancer

kr flag

When a client use our services, network first go through L4 load balancer of our cloud provider(I don't have much control over this other than customer support).

In our server, traffic first hit the NGINX layer (dockerized) then passing to the backend services.

Nginx is receiving the load balancer's IP. "X-Forwarded-For" also null in the requests.

How can I obtain the real client IP from Nginx side?

Paul avatar
cn flag
The requests arrive without any information on upstream source and you are looking for a solution that does not alter the proxy?
Januka samaranyake avatar
kr flag
@Paul Yes exactly.
Score:2
us flag

Since there is a L4 load balancer, it means that the load balancer creates the TCP connections to your nginx.

The only information available with a TCP connection is the IP address of the other end, which is load balancer in your case.

If you want to receive the actual client IP addresses, you need to use a reverse proxy, which adds the original client IP address as a header to the request to your origin server.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.