- I have docker installed on vps and now trying to configure traefik to run as reverse proxy, I have the main setup, but I have a problem with ssl, traefik creates ssl but when I open the website from browser it gives me that the certificate is invalid and not secure here is my traefik docker compose file
I want to know what is the problem in my configuration here?
to enable the ssl and redirect any http request to https
dd
version: "3.3"
services:
traefik:
command:
- --api.insecure=false
- --api.dashboard=true
- --api.debug=true
- --log.level=DEBUG
- --providers.docker=true
- --providers.docker.exposedbydefault=false
- --providers.file.filename=/dynamic.yaml
- --providers.docker.network=web
- --entrypoints.web.address=:80
- --entrypoints.web-secured.address=:443
- "--entrypoints.web.http.redirections.entrypoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- --certificatesresolvers.mytlschallenge.acme.tlschallenge=true
- --certificatesresolvers.mytlschallenge.acme.email=tareksalem19982018@gmail.com
- --certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json
- --certificatesresolvers.mytlschallenge.acme.caserver=https://acme-v02.api.letsencrypt.org/directory
volumes:
- /var/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
- /var/traefik/config.yaml:/dynamic.yaml
networks:
- web
labels:
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.permanent=true"
- "traefik.http.routers.redirs.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.redirs.entrypoints=web"
- "traefik.http.routers.redirs.middlewares=redirect-to-https"
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`monitor.dev.zaclouds.com`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.tls=true"
networks:
web:
external: true