Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Question regarding http-forwarded module

I am not sure if I am using this module correctly. It's my understanding that enabling this module allows the EE programs / api to reference the source host/ip in normal ways, while Jetty is translating the X-Forward-For: header to api's source IP/addr?

So, when I attempt to access the HttpServletRequest's request.getRemoteHost(), it still returns the address of the LB and not the address in the header. 

I wrote a simple helloworld program to show the headers being sent by the LB as per Jetty. In this case it's "X-Forwarded-For-YOUR-HOST: 1.2.3.4" (with the client's IP address 1.2.3.4). I have edited the start.d/http-forwarded.ini to set:

--modules=http-forwarded
jetty.httpConfig.forwardedOnly=false
jetty.httpConfig.forwardedForHeader=X-Forwarded-For-YOUR-HOST

Restarted and in the same helloworld program, request.getRemoteHost/getRemoteIP still returns the IP of the LB while the header spit out shows the client ip.

So I think I am misunderstanding something, or perhaps it is configured incorrectly, thanks for any help.

-e

Back to the top