Feign / Eureka Client Does Not Pass X-Forwarded-For Header

I use the Spring boot + Eureka + Feign client to forward requests from one discovered server to another, and it works great.

On my server, I need to get the IP of the original user.

I can't seem to find how to configure the Feign client to automatically edit the "X-Forwarded-For" header so that I can retrieve the user's original IP address.

When I use getRemoteAddr (), I get the proxy IP address (as expected). When you try to retrieve request.getHeader ("X-Forwarded-For"), I always get null.

Where can I add / configure this feature?

+5
source share

Source: https://habr.com/ru/post/1242549/


All Articles