Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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?)


share|improve this question
why was this message blocked? – Jas Jul 28 '11 at 11:14
up vote 0 down vote accepted

Question 1 - add a backup directive on the secondary server -

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.

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


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.