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

I am trying to use HAproxy to redirect legacy ASP requests to our ASP server like this:

    log local2
    chroot      /var/lib/haproxy
    pidfile     /var/run/
    maxconn     4096
    user        haproxy
    group       haproxy
    nbproc      2

    mode                    http
    log                     global
    option                  httplog
    option                  dontlognull
    option http-server-close
    option forwardfor       except
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 4096

frontend  main
    acl url_legacy  path_beg        -i /wsMMC
    acl url_legacy  path_end        -i .asmx
    acl url_static  path_beg        -i /public
    acl url_static  path_end        -i .jpg .jpeg .png .gif .ico .css .zip .tgz .gz .rar .bz2 .pdf .txt .tar .wav .bmp .rtf .flv .swf .html .htm .apk .jad
    use_backend static      if url_static
    use_backend legacy      if url_legacy
    default_backend www

backend www
    balance roundrobin
    server app1 check
    server app2 check

backend static
    balance roundrobin
    server app1 check
    server app2 check

backend legacy
    server legacy check

However the server response I get is 404 - resource not found. Going directly to returns the correct exception code (since I am using GET not POST). Any suggestions?

I tried replacing the path begin with /images and path end with .png and I can retrieve our logo file without issues.

The remote server ( is an IIS7 Windows machine.

share|improve this question
What's logged by IIS for the request that 404s? – Shane Madden Feb 24 '12 at 22:46
Hi Shane, I cannot find any requests in the IIS logs that would relate to this. Error 404 or otherwise. – Lukasz Feb 25 '12 at 0:54
So it's sending the request to the wrong backend - can you provide the rest of the config? – Shane Madden Feb 25 '12 at 1:05
Hi Shane - I posted the full config into the main question. – Lukasz Feb 27 '12 at 16:34

The IIS server must bind to the same domain as the domain used by the proxy. In my example the HAproxy is bound to while the IIS only listens on After adding to list of names IIS should accept the forwarding started to work.

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.