Replacing nginx with traefik for websockets

Hi there :wave:

I'm trying to replace my current nginx setup with traefik. But something is wrong with websockets. For a minimal example here I have my compose file and nginx config which works well, and a compose file with traefik which does not work: docker-compose.nginx.yml · GitHub.

Could anyone help me to identify the difference between these two setups and what's missing in the compose file with traefik that makes it fail to work with websockets the same as nginx config?

Headers and HTTP version the app receives is the same for both variants by the way.

Try removing this line:

traefik.http.routers.app.service=app

The service setup is handled by Docker Configuration Discovery, it's not needed and may result in your problem.

Let the community know if this worked, so others can make use of it, too.

Thank you. I found my app had a wrong healthcheck which made traefik ignore its router due to a failed healthcheck state. The config itself is fine.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.