Failing health check not taking service offline

Hi everybody,

I have a small nginx that I ocassionally take "offline" by deliberately failing the health check, which works with traefik 1.7.12 but no longer in v2.0.1

I have configured the health check as below and see the health check in the nginx log giving a 404 , but even then, the server is still available. Am I missing something?

My config is as follows:

services:
  app:
    cpus: 0.2
    mem_limit: 256M
    restart: always
    image: nginx
    expose:
     - "80"
    labels:
      - "traefik.docker.network=web"
      - "traefik.enable=true"
      - "traefik.http.routers.stuffhttps.rule=Host(`host1`) || Host(`host2`)"
      - "traefik.http.routers.stuffhttps.entrypoints=https"
      - "traefik.http.routers.stuffhttps.tls.certresolver=default"
      - "traefik.http.routers.stuffhttps.middlewares=sec@file"


      - "traefik.http.routers.stuffhttp.middlewares=redirect"
      - "traefik.http.routers.stuffhttp.rule=Host(`host1`) || Host(`host2`)"
      - "traefik.http.routers.stuffhttp.entrypoints=http"
           
      - "traefik.http.middlewares.redirect.headers.sslredirect=true"
      
      - "traefik.http.services.stuffhttps.loadbalancer.healthcheck.path=/health.on"
      - "traefik.http.services.stuffhttps.loadbalancer.healthcheck.interval=15s"
      - "traefik.http.services.stuffhttps.loadbalancer.healthcheck.timeout=2s"

I can see the health check failing and also the server in the traefik dashboard turns "red", but I'm still able to download files from the nginx.

I had also opened an issue (https://github.com/containous/traefik/issues/5231) but it was closed as fixed, but it still does not work

Any ideas?