Nginx, sticky session and IIS

iisload balancingnginx

I am using nginx as the load balancer and IIS to server asp.net pages. However I am having trouble figuring out how to set sticky session in nginx. Is it possible? Thanks.

Best Answer

The Upstream module does this. In http section:

upstream app {
  ip_hash;

  server backend1;
  server backend2;
}

In your location:

location / {
  proxy_pass http://app;
}