I've been struggling with creating a reverse proxy with wild card certificates for my local home lab. I tried Wolfgang's solution using duckdns.org with Nginx but it never works. I tried TechnoTim's solution but got confused. I have a sysadmin and developer background and need help (step-by-step) using traefik in docker. Thank you!
@dirtyharrywk welcome to the forums! Traefik and Docker with LetsEncrypt can definitely make you pull your hair out when getting started. Here are a couple of posts that I have written. I am not sure if you have looked at these as of yet. Let me know where you are running into issues. Normally it is always something small that trips many up with this.
If you want to go the Traefik route:
https://www.virtualizationhowto.com/2023/02/traefik-letsencrypt-certificates-configuration/
If you want to try Nginx Proxy Manager (it is the easiest since it has a GUI):
Hopefully we can work through the issues 👍
@dirtyharrywk Also keep in mind, you will need to have a real registered domain out there that is reachable with DNS. What DNS provider are you using?
I'm confused on the step "Redirect to HTTPS". Where does that go? The traefik.yml file already has "middlewares" for HTTP.
traefik.yml:
providers: docker: exposedByDefault: false file: filename: /etc/traefik/dynamic.yml http: routers: dashboard: rule: Host(`traefik.MY_DOMAIN.com`) service: api@internal middlewares: - traefik-auth tls: certResolver: dns-cloudflare middlewares: traefik-auth: basicAuth: users: - "admin:admin" certificatesResolvers: dns-cloudflare: acme: email: MY_EMAIL_ADDRESS storage: /letsencrypt/acme.json dnsChallenge: provider: cloudflare delayBeforeCheck: 0 caServer: https://acme-v02.api.letsencrypt.org/directory
traefik.yml:
providers: docker: exposedByDefault: false file: filename: /etc/traefik/dynamic.yml http: routers: dashboard: rule: Host(`traefik.MY_DOMAIN.com`) service: api@internal middlewares: - traefik-auth tls: certResolver: dns-cloudflare middlewares: traefik-auth: basicAuth: users: - "admin:admin" redirect-to-https: redirectScheme: scheme: https certificatesResolvers: dns-cloudflare: acme: email: MY_EMAIL storage: /letsencrypt/acme.json dnsChallenge: provider: cloudflare delayBeforeCheck: 0 caServer: https://acme-v02.api.letsencrypt.org/directory
log file is displaying this:
2024/02/20 17:21:51 command traefik error: field not found, node: middlewares