nimble icon indicating copy to clipboard operation
nimble copied to clipboard

Changes in the way remoteAddr and remoteHost are calculated and ES

Open beettlle opened this issue 13 years ago • 0 comments

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:

  1. If ClientIP is set that should be used
  2. If ClientIP is not set use X-Forwarded-For
  3. If XFF is missing then use the same method as used in original code
  4. Make sure XFF to get the first IP from XFF is there is more than one (chain of proxys)

For remoteHost:

  1. 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

beettlle avatar Oct 05 '10 14:10 beettlle