Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How can I log client Ip in postclientflow?

Apologies, but this subject keeps cropping up and most of the posts I have come across are now too old so I will ask again. I want to log the originating client IP address in the postclientflow of my API proxy. There are a number of things that I need clarification on.

1. If I log 'client.ip' value, this always seems to contain an address from the internal IP range (e.g

192.168.81.85). Where is this being populated?

2. If I set the 'X-Forwarded-For' header to some value, then this gets populated into the 'client.ip' and will be logged with one exception - if a node.js target is called, the client.ip address again contains an internal IP address.

This is a bit problematic since at the moment, the 'X-Forwarded-For' header can to set to any value and the edge platform will accept it and use it (it seems). It also appears, the original X-Forwarded-For value is then thrown away if a node.js target is called.

How is it possible to reliably log the originating Client IP address?

0 6 1,562
6 REPLIES 6