微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

nginx-lua-ds-loadbalancer

程序名称:nginx-lua-ds-loadbalancer

授权协议: Apache

操作系统: 跨平台

开发语言: Lua

nginx-lua-ds-loadbalancer 介绍

@H_502_0@

@H_502_0@Nginx-lua-ds-loadbalancer 是一个HTTP负载均衡器,基于liseen/lua-resty-http

@H_502_0@A http loadbalancer which is based on liseen/lua-resty-http

@H_502_0@将代码放在位于Nginx根目录下的lua/ds_lb/下

@H_502_0@Put the code into the directory lua/ds_lb which is located in the root
directory of the Nginx

@H_502_0@在Nginx.conf的http段中添加如下配置:

@H_502_0@Add the config below to the http seg in Nginx.conf:

lua_package_path "/u/Nginx/lua/ds_lb/?.lua;;";
lua_need_request_body on;
init_by_lua_file lua/ds_lb/init.lua;
@H_502_0@在Nginx.conf的location段中添加如下配置:

@H_502_0@Add the config below to the location seg in Nginx.conf:

location / {
        content_by_lua_file lua/ds_lb/lb.lua;
    }
@H_502_0@负载均衡器的配置在config.lua中

@H_502_0@You can config loadbalancer with the file config.lua

@H_502_0@可以自己定制调度策略,只需在sched文件夹下创建相关的调度策略文件,在其中提供get_selected_server()函数即可

@H_502_0@You can custom your sched strategy by just creating the sched file in the
“sched” directory,and provide the function get_selected_server()

nginx-lua-ds-loadbalancer 官网

https://github.com/Hevienz/nginx-lua-ds-loadbalancer

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐