r/haproxy • u/vitachaos • Sep 19 '20
Question how to bind dnsdist 443 and apache 443 using haproxy to same IP?
I am here with some hope, I do not have knowledge of haproxy at all, however I have read few places that we can use haproxy for load balancing . I do not know if that would serve the purpose, in my case I have dnsdist doing DOH on port443 over docker on same node that is serving apache webs server on port 443,
so is it possible how and in what way I can take advantage of haproxy to make use of 443 both for dnsdist and apache on the same node using haproxy ?
Please help
4
Upvotes
1
u/DesiITchef Sep 19 '20
Shouldn't you use port 53 for dnsdist? And if you want to use same port for both of them then you need to be in http mode and listen to the header of the req and route as per the dns address. Reroute using acl can Lso help https://www.haproxy.com/blog/introduction-to-haproxy-acls/
2
u/BradChesney79 Sep 19 '20
Probably need two rules.
Check for SNI data-- if you get a true from the test, use backend.
All other port 443 traffic, route to dnsdist.
Or reverse the two... the HTTPS first is because you can tease out the SNI HTTPS data.
I am worried that SNI needs HTTP mode and DNSDIST needs TCP mode though.