Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How can i achive the following with HAProxy with regards to its simple tutorial found here:

http://www.webhostingtalk.com/showthread.php?t=627783

I would to use HAProxy first direct all trafic to primary if off direct to secondary if primary back redirect back to primary

Is there also an option to discard some of the requests by the proxy? for example all requests /tothisplace to discard at this HAProxy level?

Also is there anything much simpler than HAProxy that I can use to achieve that? (I used in the past simpleproxy for other usage and it was very easy to use, is there a way to do it with simpleproxy?)

thanks

share|improve this question
    
why was this message blocked? –  Tomer Jul 28 '11 at 11:14

1 Answer 1

up vote 0 down vote accepted

Question 1 - add a backup directive on the secondary server - http://code.google.com/p/haproxy-docs/wiki/ServerOptions

server pri <address>[:port]
server sec <address>[:port] backup

Question 2 - You can create an ACL based on the requested url, using url_end or something like that, and redirect it to an 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 .
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.