Question

We are using Amazon EC2 services to host our play application on live. I have a quite important problem with Elastic Load Balancer. In my application I need request remote address and I am using play framework controller's request.remoteAddress property for it. However on Amazon it is stored always as load balancers ip address which is misleading us as we cannot track request remote address.

Is there something like a setting in Amazon ELB Configuration for forwarded requests? In Apache i think there is a solution for that but I have skimmed through ELB documentation and could not find any clue.

Was it helpful?

Solution 2

I think I found an elegant solution that Play Framework have a support such as XForwardedSupport. I am planning to test it in a short while.

Details of XForwardedSupport is here

OTHER TIPS

i think you can use this when you a behind an proxy or load balancer:

String ip = Http.Request.current().headers.get("x-forwarded-for")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top