haproxy 2.6 发布
原创
©著作权归作者所有:来自51CTO博客作者rongfengliang的原创作品,请联系作者获取转载授权,否则将追究法律责任
haproxy 2.6 发布了,提供了不少特性,其中quic (http3) 是可以直接使用了(注意依赖openssl 版本)我已经构建一个版本
http3 参考使用
dalongrong/haproxy:2.6-debian-quic
#---------------------------------------------------------------------
# Example configuration for a possible web application. See the
# full configuration options online.
# https://www.haproxy.org/download/2.6/doc/configuration.txt
# https://cbonte.github.io/haproxy-dconv/2.6/configuration.html
#---------------------------------------------------------------------
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# to have these messages end up in /var/log/haproxy.log you will
# 1) configure syslog to accept network log events. This is done
# by adding the '-r' option to the SYSLOGD_OPTIONS in
# 2) configure local2 events to go to the /var/log/haproxy.log
# file. A line like the following can be added to
# local2.* /var/log/haproxy.log
pidfile /var/run/haproxy.pid
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
option forwardfor except 127.0.0.0/8
timeout http-keep-alive 10s
nameserver ns1 127.0.0.11:53
bind :443 ssl crt /etc/haproxy/certs/dalong.com/cert.crt alpn h2
# enables HTTP/3 over QUIC
bind quic4@:443 ssl crt /etc/haproxy/certs/dalong.com/cert.crt alpn h3
http-request redirect scheme https unless { ssl_fc }
# Switches to the QUIC protocol
http-response set-header alt-svc "h3=\":443\";ma=2592000;"
default_backend webservers
server web1 app:80 check maxconn 30 resolvers mynameservers
http-request use-service prometheus-exporter if { path /metrics }
参考效果
说明
quic 协议是很复杂的,http3 稳定以及可以大规模应用还是需要一段时间的
参考资料
https://www.haproxy.com/blog/announcing-haproxy-2-6/
https://http3-explained.haxx.se/en/why-quic
https://github.com/rongfengliang/haproxy-quic
https://github.com/haproxytechblog/haproxy-2.6-http3
https://http3check.net/