Getting actual Client IPs in the X-Forwarded-For header

1 0 2,262

At times we require the actual Client IP to be logged in Apigee layer before request reaches backend.

This gets hidden is we are using ELB as the X-Forwarded-For header shows ELB internal IP.

Below are the three ways to get actual client IP:

1) Update the ELB config to listen on the SSL protocol instead of TCP

We can use below doc to achieve the same:

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/using-elb-listenerconfig-quick...

2) Setting up https till ELB and then plain http between ELB and router

3) Removing ELB from the picture and sending requests directly to the router.

Below is the flow of above three options:

1) Client ------( https ) ----- > ELB -----(https)----> router

2) Client-----(https) ----> ELB -----(http) ----> router ( Cavaet : Traffic between ELB and router is http)

3) Client -----(https) -----> Routers

Eventually all the ELBs will be removed and requests will be sent directly to routers.

But if we are still using ELBs then we can go with first two options to get actual client IP.

Regards,

Jagjyot

Version history
Last update:
‎08-29-2016 10:19 PM
Updated by: