users@jersey.java.net

[Jersey] Re: UriInfo_at_getBaseUri() with a load balancer

From: cowwoc <cowwoc_at_bbs.darktech.org>
Date: Wed, 05 Mar 2014 12:39:07 -0500

I'm guessing this depends on the HOST header the client sends and
whether anyone transforms it along the way. Meaning, in theory it would
be the load-balancer address. That being said, this is a total guess.
I'm curious what the JAX-RS authors have to say on this topic.

Gili

On 05/03/2014 12:14 PM, Eric Stein wrote:
> Let's say I put a load balancer in front of my Jersey API server. So a client would call:
>
> http://mylb.example.com/api/resources/12
>
> which would push the call through to one of
>
> http://server1.example.com/api/resources/12
> or
> http://server2.example.com/api/resources/12
>
> When I call UriInfo#getBaseUri(), what will I see?
> http://mylb.example.com/
> or
> http://server1.example.com/
>
> Thanks,
> Eric
>
>