Java, the IP address and reverse proxy
Okay so there is the getRemoteAddr() method of HttpServletRequest, but when you’re using a reverse proxy that won’t work and it will just return 127.0.0.1
If so, look for the header ‘X-Forwarded-For‘ of your request object. (request.getHeader("X-Forwarded-For")).
But this will return null if using non-reverse proxy. ![]()
thanks to POLONKAI Gergely
- BROWSE / IN TIMELINE
- « Linux: finding files given text within…
- » maven and ear packaging
- BROWSE / IN Java
- « Transposing Records into One Field
- » maven and ear packaging
SPEAK / ADD YOUR COMMENT
Comments are moderated.
You must be logged in to post a comment.

