The keyword “use_backend”, with an ACL condition, will allow you to choose which backend should be used HAProxy version 2.0.19 - Configuration Manual
You may find useful information about tcp/sni routing at HAProxy version 2.0.19 - Configuration Manual and you can look at some of Lukas posts in this discourse, he posted plenty of config sample.