I use Spring boot + Eureka + Feign client to forward requests from one discovered server to another and it works fine.
In my server I need to get the IP of the original user.
I can't seem to find how to configure Feign client to automatically edit the 'X-Forwarded-For' header so I could be able to extract the original user's IP address.
When I use getRemoteAddr() I get the proxy IP address (As expected). When Trying to extract the request.getHeader("X-Forwarded-For") I always get null.
Where should I add / configure this feature?
You need to add your own interceptor which adds this header to requests.
There is a good example in Feign docs (but probably it wasn't there at the time of asking this question):