@
olaloong 补充一下 haproxy 的配置,我是把 SSH HTTP HTTPS 监听在了同一个端口上
frontend main
mode tcp
bind *:12482
# acl 规则
tcp-request inspect-delay 3s
acl is_ssh req.payload(0,3) -m bin 535348
acl is_http req.proto_http
acl is_ssl req.ssl_hello_type 1
# 设置四层允许通过
tcp-request content accept if is_ssh
tcp-request content accept if is_http
tcp-request content accept if is_ssl
tcp-request content reject
# 分发到对应的 backend
use_backend ssh if is_ssh
use_backend http if is_http
use_backend https if is_ssl
backend http
mode tcp
server http 127.0.0.1:80
backend https
mode tcp
server https 127.0.0.1:443
backend ssh
mode tcp
server ssh 127.0.0.1:22