I switched from Application Load Balancer to Network Load Balancer for my application running on ECS Fargate because my application needed static IP address.
Now I am unable to get source/client IP address from X-Forwarded-For
or X-Real-Ip
HTTP headers. In both of these headers, I am getting private IP. While on Application Load Balancer I was able to get client IP from X-Forwarded-For
header.
Documentation here says that NLB preserves source IP address.
I couldn't yet troubleshoot the issue. What I might be doing wrong?
If this is not possible using Network Load Balancer, How can I achieve my following objectives, given that my application is running on AWS ECS-Fargate :
Have a static IP (e.g. for A record, IP whitelisting etc)
Can extract client IP address (e.g. for region-based business logics using GeoIP etc)
X-Forwarded-For
headers using NLB, updated my question in the hope of finding a solution to my two objectives. – varnothing