I have found that a random domain has set its DNS records to point to my server's IP address, which is a HAProxy load balancer in front of 4 apache servers. How do I prevent HAProxy from accepting requests from this domain, and only allowing requests to the legitimate domain?
Thanks
Filter on the value of the
Host
HTTP header, e.g.hdr(Host) -i myhost.example.tld
.In the
frontend
definition in your HAProxy config:You could also outright block it if you prefer by using: