Hi all,
I have a Traefik deployment in a docker swarm cluster with 3 masters. There is a Traefik instance running on each master. I have a ReactJS app being served with nginx.
So the flow would be like
[Internet] -> [Traefik LB] -> [Nginx serving ReactJS]
But there is a problem, when trying to access the app, sometimes if I hit one of the backends(there are 3 nginx backends) the apps loads properly, but if traefik tries to redirect the request to one of the other two backends I get 502.
I did configure sticky sessions to check if it solves the problem, but not really.
Just for the sake of testing, I scaled down the app to only one instance, and it did work properly. The problem is with the scaled app. Also I'm hitting one traefik instance, instead of hitting different traefik nodes, so to simplify the debugging.
My service has to following labels
- "traefik.enable=true"
- "traefik.docker.network=traefik-net"
- "traefik.http.routers.frontend.rule=Host(`app.example.com`)"
- "traefik.http.routers.frontend.entrypoints=https"
- "traefik.http.services.frontend.loadbalancer.server.port=8080"
- "traefik.http.services.frontend.loadbalancer.sticky=true"
- "traefik.http.services.frontend.loadbalancer.sticky.cookie.name=StickyCookie"
- "traefik.http.routers.frontend.tls=true"
I would appreciate if someone can point me in the right direction to debug and solve this issue.
thanks.