How to redirect to https with label in docker-compose file?

Using version: traefik:1.7.3-alpine

How can I redirect to https with label for one specific service only in docker-compose file?

(I find it very confusing where to find the complete reference documentation for docker concerning what labels to use. I have looked at (not sure if that is the right doc..?) and tried different labels related to https without succeeding. And in the same page there is only "Backend" documentation - where is the Frontend one for instance? It seems very incomplete). I have tried (it is not clear to me in the documentation which one, if any of them, to use)

traefik.protocol: https  # Gives "Bad Gateway"
traefik.frontend.redirect.entryPoint: https   # Gives "404 Page not found"

I have now also tried It seems like the port redirection takes effect, but not the protocol one :

traefik.http.middlewares.mytest.redirectscheme.scheme: https
traefik.http.middlewares.mytest.redirectscheme.port: 8443

No difference if I add the permanent: true line as well (whatever "permanent" mean in this case...).

traefik.http.middlewares.mytest.redirectscheme.scheme: https
traefik.http.middlewares.mytest.redirectscheme.permanent: true
traefik.http.middlewares.mytest.redirectscheme.port: 8443

Neither if I quote "https" it works...

EDIT: After adding a lot of different labels it now at least looks to me like it is right - but still I get "404 page not found". Here is the docker compose file labels:

  traefik.frontend.rule: "Host:mytest.${PROJECT_NAME}.${DOCKER_HOSTNAME}"
  traefik.frontend.passHostHeader: "true"
  traefik.frontend.entryPoints: http,https
  traefik.frontend.redirect.entryPoint: "https"
  traefik.port: "8080"
  traefik.http.middlewares.main.redirectscheme.protocol: https
  traefik.http.middlewares.main.redirectscheme.port: 8443

The traefik dashboard shows that the backend server is

which is what I would expect. Even though the link URL I then click is


I do get "404 page not found"
If I try to access

directly I do come to my page. What on earth is missing now?
(NOTE: I have a link http://myproject.localhost/ that is working fine (it does not include any redirection though), so I have got something right with Traefik at least. Here is my traefik docker service:

    restart: always
    image: traefik:1.7.3-alpine
    command: --debug --api --docker
      traefik.port: "8080"
      traefik.frontend.rule: "Host:traefik.${DOCKER_HOSTNAME}"
      - "${TRAEFIK_HTTP}:80"
      - proxy
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./traefik.toml:/etc/traefik/traefik.toml



you mixed Traefik v1 and Traefik v2 configuration.

Take a look to this following documentation:


Well, as you can see I already have that line.
If I remove v2 lines, and it looks like this

  traefik.frontend.rule: "Host:main.${PROJECT_NAME}.${DOCKER_HOSTNAME}"
  traefik.frontend.passHostHeader: "true"
  traefik.frontend.entryPoints: http,https
  traefik.frontend.redirect.entryPoint: "https"
  traefik.port: "8080"

it still fails, and the Traefik dashboard will show the backend as


which is not as expected (it does not look as I would expect it anyway since it is the wrong scheme and wrong port).

The documentation at does not mention anything about any version support.