Table of Contents

Traefik + Docker + HTTPS with Let's Encrypt

Basic Bringup

These steps worked to bring up Traefik + Docker + HTTPS with Let's Encrypt: Docker-compose with Let's Encrypt: HTTP Challenge

HTTP to HTTPS Redirect

Add these to the servicestraefikcommand list:

You must also include the following in servicewhoamilabels:

  1. Both web and websecure entrypoints
    • Either, define both entrypoints: traefik.http.routers.whoami.entrypoints=web,websecure
    • Or, do not define any entrypoints and Traefik will bind to all configured entrypoints - do this if you only have one http and https entrypoint each and want a more concise Compose file
    • If the service (and it's host) is not bound to the plain HTTP entrypoint, Traefik will not be able to find a valid router for the hostname and return a HTTP 404
  2. The certificate resolver, even if it is already defined globally in the entrypoint
    • traefik.http.routers.whoami.tls.certresolver=myresolver

Pitfalls/Things that Did Not Work for Me

Extras