Hi there,
I upgraded to Traefik2 to see if my websocket problem could be solved. But no. I am running into the same issue.
The original post for traeffik1 is here: Websockets don't work in docker swarm with scale > 1
We added a container that requires websocket connections. When only one container is running, everything works as expected. When we scale the container up, the websocket cannot connect anymore.
As soon as we scale down to one container it works.
Here is the Labels section of our container:
traefik2.enable: "true"
traefik.http.routers.chatexample.rule: Host(`chatexample.xxx`)
traefik.http.routers.chatexample.entrypoints: websecure
traefik.http.routers.chatexample.tls: "true"
traefik.http.services.chatexample.loadbalancer.server.port: 3000
traefik.http.services.chatexample.loadbalancer.sticky: "true"
traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto: "https"
This is the traefik config
global:
checkNewVersion: true
sendAnonymousUsage: true
## Static configuration
entryPoints:
web:
address: ":80"
websecure:
address: ":443"
providers:
providersThrottleDuration: 42
docker:
constraints: "Label(`traefik2.enable`, `true`)"
watch: true
endpoint: tcp://socat:2375
useBindPortIP: true
swarmMode: true
network: se-net
swarmModeRefreshSeconds: 10
file:
directory: "/etc/traefik/dynamic" <= just contains the TLS cert
watch: true
api:
insecure: true
dashboard: true
debug: true
log:
level: INFO
It seems that over people had similar issues but it was never quite the same and I tried all of those solutions. Maybe someone else knows what's going here.
Andy