Hello!
On Fri, Jun 17, 2016 at 10:45 AM, RJoshi wrote:
>
> Upstream has two servers configured. Let's say initial client request was
> routed through the server A. For this request, response header contains the
> session-id header. For subsequence requests with the same session-id header,
> I need to route to the same upstream server. Basically session stickiness
> across multiple Nginx nodes.
>
> if there was a way to retrieve the information on which upstream server
> routed the request, I can add that information as part of the session-id
> header in the response before sending to the client. and for subsequent , I
> can retrieve the upstream server information and route to that server.
>
Maybe the $upstream_addr variable is what you need here?
http://nginx.org/en/docs/http/ngx_http_upstream_module.html#variables
Regards,
-agentzh