2024-11-25T16:35:39 Debug caddy "debug","ts":"2024-11-25T15:35:39Z","logger":"layer4.matchers.tls","msg":"matched","remote":"176.3.82.66:62279","server_name":"opn-cp-be-02.pischem.com"} 2024-11-25T16:35:38 Debug caddy "debug","ts":"2024-11-25T15:35:38Z","logger":"layer4.matchers.tls","msg":"matched","remote":"176.3.82.66:62451","server_name":"opn-cp-be-02.pischem.com"} 2024-11-25T16:34:56 Debug caddy "debug","ts":"2024-11-25T15:34:56Z","logger":"layer4.matchers.tls","msg":"matched","remote":"176.3.82.66:62470","server_name":"opn-cp-be-01.pischem.com"} 2024-11-25T16:34:56 Debug caddy "debug","ts":"2024-11-25T15:34:56Z","logger":"layer4.matchers.tls","msg":"matched","remote":"176.3.82.66:62274","server_name":"opn-cp-be-01.pischem.com"}
servers { protocols h1 h2 h3 listener_wrappers { layer4 { import /usr/local/etc/caddy/caddy.d/*.layer4listener @a1bec573-cedd-495a-b356-922fd681697f tls sni opn-cp-be-01.pischem.com route @a1bec573-cedd-495a-b356-922fd681697f { proxy tcp/172.16.1.121:443 { } } @c777fc6a-ce6f-48d3-b5c1-83820945e247 tls sni opn-cp-be-02.pischem.com route @c777fc6a-ce6f-48d3-b5c1-83820945e247 { proxy tcp/172.16.1.122:443 { } } } tls } }
I tested this configuration and it worked for me: