HAproxy 1.5无法正确代理后端

时间:2016-01-09 16:46:26

标签: load-balancing haproxy

我很困惑为什么这个FE似乎没有通过我的HAproxy将我连接到BE:

defaults
   mode http
   log global
   option  httplog
   option  dontlognull
   source 0.0.0.0 usesrc clientip  # transparent proxy mode

frontend fe-kb
   bind :8081 ssl crt /etc/haproxy/ssl/ssl-key.pem
   default_backend be-kb

backend be-kb
   server afnB afnB:1080 check

我在HA http日志中得到了这个:

Jan  9 17:25:04 localhost haproxy[17266]: <ip redacted>:51396 [09/Jan/2016:17:24:44.544] fe-kb~ be-kb/afnB 31/0/-1/-1/20036 503 212 - - cC-- 0/0/0/0/3 0/0 "GET / HTTP/1.1"

我可以通过HAproxy CLI正常连接(禁用selinux):

[root@hapA ~]# telnet afnB 1080
Trying 10.45.69.14...
Connected to afnB.
Escape character is '^]'.
GET / HTTP/1.0

HTTP/1.1 200 OK
Server: nginx/1.9.9
Date: Sat, 09 Jan 2016 16:40:44 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Wed, 09 Dec 2015 15:05:19 GMT
Connection: close
ETag: "5668432f-264"
Accept-Ranges: bytes

<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
...

1 个答案:

答案 0 :(得分:0)

想出来,默认路由不是通过我的HAproxy,因为我试图做好源IP的透明度;)

感谢收看!