注意,这也已在http://thread.gmane.org/gmane.comp.web.haproxy/27737中发布。
我们正在尝试配置这个体系结构:
在将ELB配置为SSL+Proxy协议之后,我们尝试通过在HTTPS前端的绑定中添加接受代理来配置HAProxy:
frontend https-in
mode http
# Note, I truncated this line because the maillist 80 chars limitations
bind :443 accept-proxy ssl crt \
/var/vcap/jobs/haproxy/config/cert.pem \
no-sslv3 ciphers ...
...但它失败了:Received something which does not look like a PROXY protocol header。
排除故障后,我发现ELB在SSL流中发送代理报头。例如,我将openssl作为服务器运行:
$ openssl s_server -accept 443 -cert cert.pem
...
ACCEPT
bad gethostbyaddr
-----BEGIN SSL SESSION PARAMETERS-----
MFUCAQECAgMDBAIAnwQABDBsAWD78V/tz9KhYw4R/kpL5YPBxfF1qcmzxlclNDuz
0KWw9aGojVogjtBkH/zZOLWhBgIEVyoquqIEAgIBLKQGBAQBAAAA
-----END SSL SESSION PARAMETERS-----
Shared
ciphers:...
CIPHER is DHE-RSA-AES256-GCM-SHA384
Secure Renegotiation IS supported
PROXY TCP4 80.194.77.90 192.168.6.14 39220 443
GET / HTTP/1.1
User-Agent: curl/7.35.0
Host: something.com
Accept: */*因此,我在HTTP中做了一个“链式”配置,一个用于使用纯TCP进行SSL终端,另一个用于“提取”代理协议并执行HTTP转换:
listen https-in
mode tcp
bind :443 ssl crt /var/vcap/jobs/haproxy/config/cert.pem no-sslv3
ciphers ...
server http 127.0.0.1:8081
frontend http-in-from-ssl
mode http
bind :8081 accept-proxy
option httplog
option forwardfor
reqadd X-Forwarded-Proto:\ https
default_backend http-routers这很管用!
所以我的问题是:
谢谢!
发布于 2017-11-29 02:34:41
以下是您的问题1的信息,请参阅下面的URL。
http://docs.aws.amazon.com/elasticloadbalancing/latest/classic/using-elb-listenerconfig-quickref.html
搜索表的最后一行TCP/SSL负载均衡器(第二个表)。这只是你的案子。上面说得很清楚
不支持代理协议标头。
所以对于你的第二个问题,答案是否定的。
很抱歉,我不能为你的问题3和4提供更多的帮助。(事实上,根据我的经验,对于问题4,我认为你的方式已经足够好了。)也许我的经验还不够;
https://serverfault.com/questions/775010
复制相似问题