Route to KASM service

Hello !
I want to add a route to my KASM (link here) service instance installed in a my remote machine where Treafik is also installed. Its open port is mapped to 8443 and I can access to the interface with https://ip-of-remote-machine:8443.
I'd like to access it with a better domain name (a local one) as I've already done it with all my other services. The local domain is as such *.domain.lan.
KASM documents how to configure nginx but not Traefik in this documentation.
I'm very new to Traefik and to the routing logics, but I tried something like that.

static traefik.yml

global:
  checkNewVersion: true
  sendAnonymousUsage: false  # true by default

logLevel: INFO  # DEBUG, INFO, WARNING, ERROR, CRITICAL

api:
 dashboard: true  # true by default
 insecure: true  # Don't do this in production!

log:
  filePath: "/etc/traefik/applog.log"
  level: INFO

# Entry Points configuration
# ---
entryPoints:
  web:
    address: :80
    forwardedHeaders: 
      trustedIPs: ["127.0.0.1/32", "192.168.1.0/24"]
    transport:
      respondingTimeouts:
        readTimeout: 1800
        writeTimeout: 1800
  websecure:
    address: :443

providers:
  docker:
    endpoint: unix:///var/run/docker.sock
    watch: true
    exposedByDefault: false
  file:
    directory: /etc/traefik/dynamic
    watch: true

In my dynamic kasm.yml

---
http:
  routers:
    kasm:
      service: kasm-service
      rule: "Host(`kasm.domain.lan`)"
      tls: true
      entryPoints:
        - websecure
      
  services:
    kasm-service:
      loadBalancer:
        servers:
          - url: https://127.0.0.1:8443

But I get a "Bad Gateway" error.

How can I try to fix all that ?

I had the same issue and I was able to get it working. Here is a post on how to get it working on r/kasmweb