如何使用HAProxy实现以下简单教程:
http://www.webhostingtalk.com/showthread.php?t=627783
我将首先使用HAProxy将所有的stream量直接转移到主服务器,如果主服务器返回主服务器,则直接转到次服务器
是否还有一个选项可以丢弃代理的一些请求? 例如所有的请求/放弃在这个HAProxy级别?
还有什么比HAProxy更简单,我可以用它来实现呢? (我过去使用simpleproxy用于其他用法,它使用起来非常简单,有没有办法用simpleproxy做到这一点?)
谢谢
问题1 – 在辅助服务器上添加备份指令 – http://code.google.com/p/haproxy-docs/wiki/ServerOptions
server pri <address>[:port] server sec <address>[:port] backup
问题2 – 您可以根据请求的url创build一个ACL,使用url_end或类似的东西,并将其redirect到一个tarpit。 http://code.google.com/p/haproxy-docs/wiki/MatchingLayer7
frontend webserver bind :80 option forwardfor acl bk_deny url_end /file.ext use_backend tarpit if bk_deny default_backend default-pool backend default-pool balance ... option httpchk ... server ... backend tarpit mode http # do not hold the connection timeout tarpit 1 # Emulate a 503 error errorfile 503 /etc/errors/500_tartarus.txt # slowdown any request coming up to here reqitarpit .