用于窗口的nginx粘性模块

xia*_*min 6 plugins nginx sticky

我想使用nginx进行负载均衡.我想使用粘性模型而不是ip_hash.配置可能如下所示.

upstream loadbalance {
        sticky;
        server 192.168.120.195:8080;
        server 192.168.120.194:8080;
}
Run Code Online (Sandbox Code Playgroud)

但我遇到以下错误.

nginx:D:\ ProgramFiles \nginx-1.5.7\webapp\conf \nginx.conf中的[emerg] unknown指令"sticky":39

根据我的检查,这是因为缺少nginx-sticky-module.

对于我的服务器是Windows,我找不到窗口的nginx-sticky-module.

有人可以为窗口提供nginx-sticky-module并与我分享安装指南?

非常感谢.

小智 0

也许你可以试试这个。 https://github.com/michaelneale/nginx-sticky-module。不过你需要先获取nginx的源码。 https://github.com/nginx/nginx