Here is the scenario that I have:
Client -> A SPA application -> a Proxy -> a Backend for SPA -> Service proxy -> Service Backend.
And I want to pass on the client IP all the way to the Service Backend.
I have tried using the X-Forwarded-For, but this only works with the first proxy hop. That is, Backend for SPA is able to get the original client IP.
It is the processes of forwarding this same client IP via Service Proxy to Service backend that I am not sure how to handle. Using the same X-Forwarded-For will pass on Backend for SPA IP address to Service Backend instead of the Clients IP
What is the recommended way of handling this situation?
The thought I have is to update the code in Backend for SPA to take the clients IP it gets via X-Forwarded-For, and put it in a custom HTTP header which Service Backend can then retrieve.
Is this the recommended way? or there is more idiomatic way to handle this?