nimble
nimble copied to clipboard
Changes in the way remoteAddr and remoteHost are calculated and ES
Currently remoteAddr and remoteHost are both just taken from the headers in the request. This does not work when the application is behind a proxy or loadbalancer. I added logic to better calculate these two values.
The idea is to cascade down from better to less correct information.
For remoteAddr:
- If ClientIP is set that should be used
- If ClientIP is not set use X-Forwarded-For
- If XFF is missing then use the same method as used in original code
- Make sure XFF to get the first IP from XFF is there is more than one (chain of proxys)
For remoteHost:
- If remoteHost is localhost and remoteAddr is also localhost then we should get the domain name from the IP computed in for remoteAddr.
This has worked in my testing using Apache and mod_proxy with Tomcat6 on the backend.
I also added the spanish internationalization file requested in: http://github.com/bradleybeddoes/nimble/issues/#issue/32