如何使用haproxy在Rabbitmq服务器中显示真实IP

时间:2018-12-24 03:39:30

标签: tcp ip

listen rabbitmq_cluster
bind    0.0.0.0:5672
mode    tcp
option  tcplog
balance roundrobin
timeout client  3h
timeout server  3h
server  busappser5  192.168.0.249:5672 check  inter  5000  rise  2  fall  3
server  busappser6  192.168.0.251:5672 check  inter  5000  rise  2  fall  3
server  busappser7  192.168.0.231:5672 check  inter  5000  rise  2  fall  3

192.168.0.1 is IP of haproxy

我尝试过 首先
option tcplog balance roundrobin source 0.0.0.0 usesrc clientip


第二
server s1 127.0.0.1:7000 send-proxy-v2




第三
option forwardfor

全部无效

1 个答案:

答案 0 :(得分:0)

要以tcp模式将客户端IP地址传递给您要使用send-proxy的服务器

frontend foo
   ...
   send-proxy
   ...