How X-Forwarded-for header value populates in apigee

nandishnandy
Participant III

How Apigee edge public cloud appends IP address into “X-Forwarded-for” key in the header if requesting app/Client does not send any IP address details.?

Thanks In Advance

Nandeesha

0 4 2,744
4 REPLIES 4

sidd-harth
Participant V

Hi @Nandeesha, if you want to manually append IP address to the request/request on Apigee, we can do that with the help of Assign Message Policy.

https://docs.apigee.com/api-platform/reference/policies/assign-message-policy#addelement-addheaderse...

Please elaborate if this is not what you are looking for.

Thanks, In case of app/client, does not send IP address details which IP address apigee map to X-Forwarded-for value?

Generally speaking, X-Forwarded-for in Apigee Request Header maps to originating IP address of a client/app.

What do you mean by,

 app/client, does not send IP address details 

Hi Siddharth,

When I set the below code in the Apigee Proxy API - Assign Message policy. I am not getting client IP address.

In the Trace window I see this IP (12.36.9.1)

Could you please let me know how to get client ip address,

 

<Headers>
<Header name="x-forwarded-for">{request.header.x-forwarded-for}</Header>
</Headers>

Thanks,

Subramanya