Max Rukomoynikov

I love to create. Developer and designer. Looking forward to make cool things.

Setup Traefik endpoints

I run few services on my server and I want to access them via subdomains. I use Portainer and Docker Swarm to manage containers.

Here is the configuration of one of my services with exposed port 80 and domain name:

And then I needed to add another service and so I decided to reuse configuration above but only change domain name.

It ended up both services being not accessible. I was getting 404 error.

My mistake

# Turned out it has a part where you should give your service a unique name
traefik.http.routers.{{uniq_name_for_application}}-https.rule
traefik.http.routers.{{uniq_name_for_application}}.rule
traefik.http.routers.{{uniq_name_for_application}}.middlewares redirect-to-https
traefik.http.routers.{{uniq_name_for_application}}-https.service {{uniq_name_for_application}}