我发现一个随机域已经设置了其DNSlogging指向我的服务器的IP地址,这是一个HAProxy负载平衡器在4个Apache服务器的前面。 如何防止HAProxy接受来自该域的请求,并只允许请求到合法域?
谢谢
在HAProxyconfiguration的frontend定义中:
frontend bla bla bla <other settings> #all HTTP traffic must use the correct site name acl host-mysite hdr(Host) -i mysite.example.com redirect location http://mysite.example.com/ if !host-mysite <more settings for frontend> backend foo <backend config>
你也可以直接阻止它,如果你喜欢使用:
#block if request isn't for mysite acl host-mysite hdr(Host) -i mysite.example.com block if !host-mysite
过滤Host HTTP头的值,例如hdr(Host) -i myhost.example.tld 。