Keeping real user IP in Java web apps behind Nginx proxy
When there is an Nginx proxy in front of your tomcat (or other app server), request.getRemoteAddr() or request.getRemoteHost() will return the IP of the Nginx server. And this is obviously not what we want.
To get this right, an extra HTTP Header will have to be added in Nginx, and our web app will have to be told to use it.

