title: Why does HAProxy show that a server's check URL is a 404 when running curl on this URL is successful?
body: <p>I'm setting up HAProxy to load-balance a resource between 3 back-ends. Here is the HAProxy config : (In the following snippets I replaced the actual domain name by example.net)</p>
  
  <pre><code>global
    log 127.0.0.1 local2
    log-send-hostname
    maxconn 2000
    pidfile /var/run/haproxy.pid
    stats socket /var/run/haproxy.sock mode 600 level admin
    stats timeout 30s
    daemon
  
     # SSL ciphers
    ...
  
  defaults
    mode    http
    option  forwardfor
    option  contstats
    option  http-server-close
    option  log-health-checks
    option  redispatch
    timeout connect  5000
    timeout client  10000
    timeout server  10000
    ...
  
  frontend front
    bind *:443 ssl crt /usr/local/etc/haproxy/front.pem
    reqadd X-Forwarded-Proto:\ https if { ssl_fc }
    stats uri /haproxy?stats
    option httpclose
    option forwardfor
    default_backend back
    balance source
  
  backend back
    balance roundrobin
    option httpchk GET /healthcheck HTTP/1.0
    server server1 xxx.xxx.xxx.xxx:80 check inter 5s fall 2 rise 1
    server server2 yyy.yyy.yyy.yyy:8003 check backup
    server mysite  example.net:80 check backup 
  </code></pre>
  
  <p>The issue is the following: even though the first 2 servers respond correctly, the domain-based one always shows as a 404:</p>
  
  <p><a href="https://i.stack.imgur.com/Fyknj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Fyknj.png" alt="HAProxy stats"></a></p>
  
  <p>What is counter-intuitive to me is that if I use curl to access this same healthcheck, I get an HTTP 200 (like I would expect to see in the HAProxy stats) :</p>
  
  <pre><code>curl -I http://example.net/healthcheck
  HTTP/1.1 200 OK
  </code></pre>
  
  <p>When I ping my site, I get:</p>
  
  <pre><code># ping example.net
  PING example.net (217.160.0.195) 56(84) bytes of data.
  64 bytes from 217-160-0-195.elastic-ssl.ui-r.com (217.160.0.195): icmp_seq=1 ttl=50 time=45.7 ms
  </code></pre>
  
  <p>Is it because the IP of my domain is shared with other domains (1&amp;1 shared hosting) that HAProxy can't access it? Why is that and how to make HAProxy reach it correctly? </p>