Hello!
2014-02-26 7:38 GMT-08:00 人cc:
> 由于后边有多台proxy, 我在a.lua文件里通过ngx.location.capture("/proxy")请求下游的server,下游有很多台,
> 我不想在配置很多个location /proxy_1 ...这样的去配置,
> 想通过在a.lua里面直接修改$ip_port达到调度到不同的服务器的目的, 但是发现不行, 请问大家有没有比较好的方法。
>
请说明“不行”具体是什么错误和现象。否则我无法帮助你。通过在 proxy_pass 里指定 nginx 变量来实现动态后端分发是可行的,比如下面这个示例:
http://openresty.org/#DynamicRoutingBasedOnRedis
Regards,
-agentzh
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 openresty@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html