I want to use nginx for load balance. And i want to use the sticky model instead of ip_hash. The configuration may be like below.
upstream loadbalance {
sticky;
server 192.168.120.195:8080;
server 192.168.120.194:8080;
}
But i encounter below error.
nginx: [emerg] unknown directive "sticky" in D:\ProgramFiles\nginx-1.5.7\webapp\conf\nginx.conf:39
Per my check, it is because of lack of nginx-sticky-module.
For my server is windows and i can't find nginx-sticky-module for window.
Can some guy provide the nginx-sticky-module for window and share the installation guide with me ?
Many thanks.
NGINX Plus supports three session persistence methods. The methods are set with the sticky directive.
It is possible to use nginx as a very efficient HTTP load balancer to distribute traffic to several application servers and to improve performance, scalability and reliability of web applications with nginx.
NGINX, at its core, is a collection of modules. Whether you are using core modules, like the http and stream (TCP/UDP) modules, or third‑party modules like GeoIP or RTMP, the module framework is the same. With the addition of dynamic module support, modules are an even better way to add functionality to NGINX.
According to Nginx documentation Sticky session support is only available for their expensive Plus version. I've been researching alternatives and the closer I've been is this old fork that is not compatible with Nginx 1.5+ https://github.com/lusis/nginx-sticky-module
Nginx Plus Load Balancing
I've found another great module, see https://bitbucket.org/nginx-goodies/nginx-sticky-module-ng/src
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With