我正在使用haproxy版本1.6.2
我已经启用http2使用下面的configuration,我需要使用“模式tcp”。 但是,一旦我从“模式http”切换到“模式tcp”我不能使用acl path_beg来
frontend websocks mode tcp bind *:443 ssl crt /etc/certs/domain.pem alpn h2,http/1.1 ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH; no-sslv3 timeout client 1h acl is_api path_beg /api acl is_xmpp path_beg /chat use_backend api_backend if is_api use_backend xmpp_backend if is_xmpp use_backend fe_public_tcp if { ssl_fc_alpn -i h2 } default_backend fe_public fe_public server fe1 localhost:444 weight 1 maxconn 4096 check inter 10000 ssl verify none fe_public_tcp mode tcp server fe1 localhost:445 api_backend server api1 localhost:9966 xmpp_backend server xmpp1 localhost:9955
如何让path_beg和http2再次工作? 或者有没有办法启用http2模式TCP?
要使用协议特定function,您必须使用适当的模式。 Mode tcp只允许访问tcp的特定function,但要获得http特定function,例如根据URIselect后端,则需要使用http模式。
不幸的是,HTTP / 2与HTTP / 1.x看起来非常不同,目前不支持模式http,所以你必须使用tcp模式。 这也意味着只要你想支持HTTP / 2就不能根据URI做出任何决定。
haproxy版本1.7预计会更好地支持HTTP / 2。 来自http://www.haproxy.org/news.html :
2015年5月15日:HTTP / 2不存在!
今天,HTTP / 2正式存在为RFC7540和RFC7541。 …版本1.6将不支持HTTP / 2 …我们期望在1.7开发周期的今年年底支持它。