{
servers {
# for current 80 443
listener_wrappers {
layer4 {
@ssh_l4 ssh
route @ssh_l4 {
proxy 127.0.0.1:22
}
# PG < 17 do not support TLS SNI handshakes
# crash for now https://github.com/mholt/caddy-l4/issues/264
@pg_l4 postgres
route @pg_l4 {
proxy 127.0.0.1:5432
}
# PG 17+ libpq/jdbc ?sslnegotiation=direct&sslmode=require
@tls_pg_l4 tls sni pg.example.com
route @tls_pg_l4 {
tls {
connection_policy {
alpn postgresql
}
}
proxy 127.0.0.1:5432
}
# redis-cli -u "rediss://default:[email protected]:443" --sni redis.example.com info
@tls_redis_l4 tls sni redis.example.com
route @tls_redis_l4 {
tls
proxy 127.0.0.1:6379
}
route
}
tls
}
}
}