--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@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
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/1b12b497-c486-462e-b8a1-bf5f7dcbb612%40googlegroups.com。
有一个思路,你可以参考下1. proxy_set_header Host $my_host;2. 在 rewrite_by_lua 里计算下,得到本次上游的地址,同时设置 $my_host3. 在 balancer_by_lua 里 set_current_peer 指定上游地址(这一步也不是必须,不过,如果不这么改,就可能你有两个选取上游的逻辑了)
汪志鹏 <yannan...@gmail.com> 于2019年7月19日周五 下午5:33写道:
Hi, 各位好:--我们有个需求是通过openretry(入口必须是IP)转发流量到后端的X组服务上。后端每组服务必须通过域名访问,每组服务IP是相同的。upstream大概如下:upstream app {server www.a.com; # ip 1.1.1.1server www.b.com; # ip 1.1.1.1server www.c.com; # ip 1.1.1.2server www.d.com; # ip 1.1.1.2.....}有没有什么方法可以获取到upstream选定server后对应的域名, 然后set header Host我们本身也进行了很多测试, set header Host必须在content_generated_by?之前进行。但是在之前又获取不到当前的ngx.var.upstream_addr以及current_upstream_name、upstream.get_primary_peers等信息
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 open...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 open...@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
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+unsubscribe@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/1b12b497-c486-462e-b8a1-bf5f7dcbb612%40googlegroups.com。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/1b12b497-c486-462e-b8a1-bf5f7dcbb612%40googlegroups.com。
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@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
---
您收到此邮件是因为您订阅了Google网上论坛上的“openresty”群组。
要退订此群组并停止接收此群组的电子邮件,请发送电子邮件到openresty+...@googlegroups.com。
要在网络上查看此讨论,请访问https://groups.google.com/d/msgid/openresty/accc0613-c35f-43fd-aa03-9d2ade1777b0%40googlegroups.com。