liseen at 2010-9-26 10:46 wrote:
HI
add header 的方法不是已经可以了嘛, 呵呵。
agentzh 用的是echo模块, 把这两个变量打印出来,
建议你搜搜他的他的讲义, 之前他好像给过, 搜不到就直接问他要吧
xunxin
2010/9/17 Eric.M <[email protected] <mailto:[email protected]>
记得在五道口的聚会上,好像agent提到过可以用nginx来实现这一功能,希
望能在header中得知,此次负责执行的到底是哪个ip,哪个端口的 server,
不知道是怎么实现的,我只找到了add_header这么一个方法,却不知道如何
获得到像127.0.1:8001这样的数据进行返回,
http://wiki.nginx.org/HttpUpstreamModule#.24upstream_addr
这个变量可以记录upstream的地址。
下面是我的部分nginx.conf配置
upstream frontends {
server 127.0.0.1:8001 <http://127.0.0.1:8001>
max_fails=3 fail_timeout=30s;
server 127.0.0.1:8002 <http://127.0.0.1:8002>;
}
proxy_pass_header Server;
proxy_set_header Host $http_host;实现的
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://frontends;
--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨
论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 [email protected]
<mailto:[email protected]>。
要取消订阅此网上论坛,请发送电子邮件至
[email protected]
<mailto:perlchina%[email protected]>。
若有更多问题,请通过
http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”
论坛。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
要取消订阅此网上论坛,请发送电子邮件至
[email protected]。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN
访问此网上论坛。
--
Weibin Yao
--
您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。
要向此网上论坛发帖,请发送电子邮件至 [email protected]。
要取消订阅此网上论坛,请发送电子邮件至 [email protected]。
若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。