Not getting x-forwarded-for header from alb to service on ECS

0

x-forwarded-for header is not being to nodejs service deployed as service on ECS ( Fargate) . Checked all settings on ALB. X-Forwarded-For setting is append on ALB. Not able to figure out the issue. Please help

1 Answer
0

Hi Vix,

It appears that you have your ALB configured to append the X-Forwarded-For headers, so those should be at least reaching your endpoint for nodejs to take action.

With nodejs, the headers are seen as an array, so some extraction may be needed there. You could possibly have those headers in an array for nodejs and call out the one you are looking for. ie:request.headers[“X-Forwarded-For”]

There is also some information on Github that may beneficial to check regarding the client IP address if that is truly what you need to key in on.

Hope this helps!

AWS
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions