In my case, we had a standalone Jersey cluster running after nginx as load balancer. So the workaround was to pass the remote address as the request header, which is also easily accessible from Jersey:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
source share