Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in the way remoteAddr and remoteHost are calculated and ES #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

beettlle
Copy link

@beettlle beettlle commented Oct 5, 2010

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant