I Know that this question has been asked before. I have tried them all nothing seems to work for me
I am getting multiple IPs in X-Forwarded-For header and Application firewall i have setup depends on X-Forwarder-Header which has 3 IPs. My firewall is considering private IP address as Client IP.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AssignMessage async="false" continueOnError="false" enabled="true" name="Access-Control-1"> <DisplayName>Remove Forwarded IP</DisplayName> <Properties/> <Remove> <Headers> <Header name="X-Forwarded-For"/> </Headers> </Remove> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <AssignTo createNew="false" transport="http" type="request"/> </AssignMessage>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AssignMessage async="false" continueOnError="false" enabled="true" name="Add-Custom-Header-Value"> <DisplayName>Add Custom Header Value</DisplayName> <Properties/> <Copy source="request"> <Headers/> <QueryParams/> <FormParams/> <Payload/> <Verb/> <StatusCode/> <ReasonPhrase/> <Path/> </Copy> <Set> <Headers> <Header name="X-Forwarded-For">{client.ip}</Header> </Headers> </Set> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <AssignTo createNew="false" transport="http" type="request"/> </AssignMessage>
What configuration changes do i need to make for getting real and single IP address in X-Forwarded-For header.
What are you getting in trace for the message sent to the backend with those in place? If you need to read multiple entries from the X-Forwarded-For you might need to look at the request.header.header_name.values variable to get all the values.