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.

有帮助吗?

解决方案 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

其他提示

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")
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top