Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nginx sticky module for window

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.

like image 342
xiaomin Avatar asked Mar 25 '15 02:03

xiaomin


People also ask

Does NGINX support sticky session?

NGINX Plus supports three session persistence methods. The methods are set with the sticky directive.

Can NGINX do load balancing?

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.

What is NGINX module?

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.


1 Answers

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

like image 110
Neo X Avatar answered Oct 08 '22 04:10

Neo X