Possible issue with proxy make Jupyter constantly relaunching kernels

The issue is similar to this one but instead of using NGINX as a reverse proxy I use Traefik. I had no problem with Traefik 1.7 but switching to 2.0 made the problem appear.

This is resolved in NGINX by using proxy_http_version 1.1;

Syntax:	proxy_http_version 1.0 | 1.1;
Default:	
proxy_http_version 1.0;
Context:	http, server, location
This directive appeared in version 1.1.4.

Sets the HTTP protocol version for proxying. By default, version 1.0 is used. Version 1.1 is recommended for use with keepalive connections and NTLM authentication.

It is probably linked with the forwading of the port 9999 to the 80, but if I try to tell Jupyter to use the port 80 it will not launch, telling that the port 80 is not available...

Here is the Docker-compose.yml :

version: '3'

volumes:
  jupyter:
    driver: local

networks:
  traefik:
    external: true

services:
  jupyter:
    image: jupyter/datascience-notebook
    networks:
      - traefik
    labels:
      - "traefik.enable=true"
      # Get the data from port xxxx instead of port 80
      - "traefik.http.services.jupyter.loadbalancer.server.port=9999"
      # Get the routes from http
      - "traefik.http.routers.jupyter.rule=Host(`jupyter.mysite.com`)"
      - "traefik.http.routers.jupyter.entrypoints=web"
      # Redirect these routes to https
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
      - "traefik.http.routers.jupyter.middlewares=redirect-to-https@docker"
      # Get the routes from https
      - "traefik.http.routers.jupyter-secured.rule=Host(`jupyter.mysite.com`)"
      - "traefik.http.routers.jupyter-secured.entrypoints=web-secure"
      # Apply autentificiation with http challenge
      - "traefik.http.routers.jupyter-secured.tls=true"
      - "traefik.http.routers.jupyter-secured.tls.certresolver=myhttpchallenge"
    user: root
    working_dir: /home/mysuer/work
    volumes:
      - ./work:/home/mysuer/work
    environment:
      - JUPYTER_ENABLE_LAB=yes
      - NB_USER=myuser
      - NB_UID=1000
      - NB_GID=1000
      - CHOWN_HOME=yes
    command: start-notebook.sh --NotebookApp.token='mytoken' --no-browser --allow-root --notebook-dir=/home/mysuer/work --port 9999

I did not find how to configure Traefik to use HTTP version 1.1 for proxy...

It appeared to be a cache issue, probably with the certificates of the navigator. It works using another one.