Traefik-Konfiguration für HTTPS & Redirect (traefik.yml)

Estimated reading: 1 minute 7 views

In dieser Phase wurde die Traefik-Konfiguration erweitert, damit:

  • HTTP (Port 80) automatisch auf HTTPS (Port 443) umleitet
  • Traefik dynamische Config-Dateien überwacht
  • Let’s Encrypt weiterhin genutzt wird

Datei:
/opt/project-wiki/traefik/traefik.yml

Bearbeiten:

cd /opt/project-wiki
nano traefik/traefik.yml

Inhalt laut Projektstand:

api:
  dashboard: true

entryPoints:
  web:
    address: ":80"
    http:
      redirections:
        entryPoint:
          to: websecure
          scheme: https

  websecure:
    address: ":443"

providers:
  docker:
    exposedByDefault: false
    network: web
  file:
    directory: /dynamic
    watch: true

certificatesResolvers:
  letsencrypt:
    acme:
      email: hirsc_juli.student@bs-an.de
      storage: /letsencrypt/acme.json
      httpChallenge:
        entryPoint: web

Wichtige Punkte:

  • http.redirections.entryPoint sorgt für HTTP → HTTPS-Redirect.
  • providers.file lädt zusätzliche Konfiguration aus /dynamic.
  • certificatesResolvers.letsencrypt kümmert sich um automatische TLS-Zertifikate.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Share this Doc

Traefik-Konfiguration für HTTPS & Redirect (traefik.yml)

Or copy link

CONTENTS