Is there any way that I could get the original IP address of the client coming to the server?
I can use request.getRemoteAddr()
, but I always seem to get the IP
You cannot do this in a meaningful way.
The proxy may or may not add a proxied-for header, but in many cases this will be an internal only address anyway, so it will be meaningless to you. Most proxies at the edge of an organization are configured to reveal as little as possible about the internals of the network anyway.
What are you intending to use this information for?