title: Traefik healthcheck not working. 'Bad gateway' returned instead of redirect to active servers
body: <p>I'm learning Traefik basics, but can't get health checking to work. I have four servers, which are docker containers. The rotation is working well, when refreshing the localhost page, it shows a different server each time. Even launching multiples petitions with <em>Apache Benchmark</em> and monitoring them with <em>ctop</em>,shows a correct workload balance.  The matter came when I stop one of the servers. It is assumed that Traefik should detect the offline server and redirect to one of the active servers, but instead, when the rotation reachs the offline server, it shows a &quot;Bad Gateway&quot; message, so the health check is not working at all. I tried to replicate the documentation examples, but sure I'm missing something.</p>
  <p>This is my docker-compose.yml file:</p>
  <pre><code>version: '2.4'
  services:
    traefik:
      image: asn/traefikv1
      build: traefikv1/
      ports:
        - &quot;80:80&quot;
        - &quot;8080:8080&quot; # Web GUI
      volumes:
        # Traefik static config file
       - ./traefikv1/traefik.toml:/etc/traefik/traefik.toml  
  
    wwwserver:
      build: .
      image: phpwebapp
      ports:
        # Random external port for HTTP direct access 
        - &quot;80&quot;
        - &quot;8080&quot;
      scale: 4
      mem_limit: 50m
      mem_reservation: 25m
      volumes:
        - ./html:/var/www/html
      depends_on:
        - mariadb 
  
    mariadb:
      image: mariadb:latest
      environment:
        - MYSQL_ROOT_PASSWORD=secret
        - MYSQL_DATABASE=notesdb
        - MYSQL_USER=usuario
        - MYSQL_PASSWORD=secreto
      ports:
        - 3306:3306
  </code></pre>
  <p>And this is my traefik.toml, where the health check is defined:</p>
  <pre><code># Enable API and dashboard (:8080)
  [api]
  
  # Enable logs
  [traefikLog]
  [accessLog]
  
  # Configure timeouts
  [respondingTimeouts]
  
  [file]
  
  #Manual frontend/backend  configuration
  [frontends]
    [frontends.frontend1]
      passHostHeader = true
      entryPoints = [&quot;http&quot;]
      backend = &quot;wwwservers&quot;
  [backends]
    [backends.wwwservers]
        # Define www servers
        [backends.wwwservers.servers.server1]
            url = &quot;http://pruebastraefik_wwwserver_1:80&quot; 
        [backends.wwwservers.servers.server2]
            url = &quot;http://pruebastraefik_wwwserver_2:80&quot;    
        [backends.wwwservers.servers.server3]
            url = &quot;http://pruebastraefik_wwwserver_3:80&quot;
        [backends.wwwservers.servers.server4]
            url = &quot;http://pruebastraefik_wwwserver_4:80&quot;
        [backends.wwwservers.loadBalancer.healthCheck]
            path = &quot;/health&quot;
            interval = &quot;10s&quot;
            timeout = &quot;3s&quot;
            port= 80
  </code></pre>