Eof 502 Bad Gateway with Websocket

We are running traefik:2.9.5 on kubernetes.
There are 2 other container in the same pod as traefik on exposing a static web page on localhost:8080 the other a https websocket on localhost:8081.
Traefik redirects to one or the other base on the URI of the request.
We have consistent 502 error to requests redirected to the service exposing the websocket on 8081.
On the other side we have no evidence of problems with the http service on 8080.
This is the configuration:

 http:
  middlewares:
    workspace70af9fa9e85843ac-ide-8080-auth:
      forwardAuth:
        address: http://che-gateway.eclipse-che:8089?namespace=my_namespace
        trustForwardHeader: false
    workspace70af9fa9e85843ac-ide-8080-healthz-strip-prefix:
      stripPrefix:
        prefixes:
        - /ide/8080
    workspace70af9fa9e85843ac-ide-8080-strip-prefix:
      stripPrefix:
        prefixes:
        - /ide/8080
    workspace70af9fa9e85843ac-server-8081-auth:
      forwardAuth:
        address: http://che-gateway.eclipse-che:8089?namespace=my_namespace
        trustForwardHeader: false
    workspace70af9fa9e85843ac-server-8081-strip-prefix:
      stripPrefix:
        prefixes:
        - /server/8081
  routers:
    workspace70af9fa9e85843ac-ide-8080:
      middlewares:
      - workspace70af9fa9e85843ac-ide-8080-strip-prefix
      - workspace70af9fa9e85843ac-ide-8080-auth
      priority: 100
      rule: PathPrefix(`/ide/8080`)
      service: workspace70af9fa9e85843ac-ide-8080
    workspace70af9fa9e85843ac-ide-8080-healthz:
      middlewares:
      - workspace70af9fa9e85843ac-ide-8080-healthz-strip-prefix
      priority: 101
      rule: Path(`/ide/8080/healthz`)
      service: workspace70af9fa9e85843ac-ide-8080-healthz
    workspace70af9fa9e85843ac-server-8081:
      middlewares:
      - workspace70af9fa9e85843ac-server-8081-strip-prefix
      - workspace70af9fa9e85843ac-server-8081-auth
      priority: 100
      rule: PathPrefix(`/server/8081`)
      service: workspace70af9fa9e85843ac-server-8081
  services:
    workspace70af9fa9e85843ac-ide-8080:
      loadBalancer:
        servers:
        - url: http://127.0.0.1:8080
    workspace70af9fa9e85843ac-ide-8080-healthz:
      loadBalancer:
        servers:
        - url: http://127.0.0.1:8080
    workspace70af9fa9e85843ac-server-8081:
      loadBalancer:
        servers:
        - url: http://127.0.0.1:8081

This is the log line whrere the error is reported:

time="2022-12-15T14:33:17Z" level=debug msg="'502 Bad Gateway' caused by: EOF"

I recommend to add a kubernetes tag.

We eventually figured out that the problem was not due to treafik, but to a size limitation of the header of the final application exposing the websocket. However, I think the treafik logs could be improved to make it easier to figure out which component is to blame.