I wrote a more comprehensive question here: Grampsweb behind Traefik in Docker Swarm - Bad Gateway
This one can be closed.