0

Having a bizarre problem where I enable swarm mode in Traefik v2.2.0 using the following command:

command:
  - "--providers.docker.swarmMode=true"

It causes Traefik to fail completely (every url gives a page not found error).

Also, a side problem which may be related is how I managed to get the dashboard working. The only way which seemed to work is:

  - "traefik.enable=true"
  - "traefik.http.routers.api.rule=Host(`<site ip>`) && (PathPrefix(`/traefik`) || PathPrefix(`/api`))"
  - "traefik.http.routers.api.middlewares=strip-traefik"
  - "traefik.http.middlewares.strip-traefik.stripprefix.prefixes=/traefik"

Yet when I visit /traefik the URL that's shown is /traefik/dashboard.

I thought that the /traefik element is removed by stripprefix?

I'm using an Azure virtual machine which is only IP based, not sure if that's anything to do with it.

Thanks for any suggestions.

1 Answer 1

2

In Swarm Mode, the labels should be defined in the deploy part of your service.

deploy:
  labels:
    - "traefik.enable=true"
    ...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.