Slow access on reverse proxy

I'm running Traefik on a Raspberry Pi 5 with the following docker-compose.yml configuration:

networks:
  frontend:
    name: frontend

volumes:
  traefik_acme:
    name: traefik_acme

services:
  traefik:
    image: "traefik:v3"
    container_name: "traefik"
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    environment:
      - CF_API_EMAIL=${CF_API_EMAIL}
      - CF_DNS_API_TOKEN=${CF_DNS_API_TOKEN}
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - traefik_acme:/letsencrypt
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    networks:
      - frontend
    command:
      - --api.dashboard=true
      - --log.level=INFO
      - --accesslog=true
      - --providers.docker=true
      - --providers.docker.exposedByDefault=false

      
# Configuração do EntryPoint HTTP para Redirecionamento
      
- --entrypoints.web.address=:80
      - --entrypoints.web.http.redirections.entrypoint.to=websecure
      - --entryPoints.web.http.redirections.entrypoint.scheme=https

      
# Configuração do EntryPoint HTTPS Seguro
      
- --entrypoints.websecure.address=:443
      - --entrypoints.websecure.asDefault=true
      - --entrypoints.websecure.http.tls=true
      - --entrypoints.websecure.http.tls.certresolver=le

      
# Configuração do Resolvedor ACME via Cloudflare DNS Challenge
      
- --certificatesresolvers.le.acme.email=${CF_API_EMAIL}
      - --certificatesresolvers.le.acme.storage=/letsencrypt/acme.json
      - --certificatesresolvers.le.acme.dnschallenge=true
      - --certificatesresolvers.le.acme.dnschallenge.provider=cloudflare
    labels:
      - traefik.enable=true
      - traefik.http.routers.dashboard.rule=Host(`traefik.${DOMAIN}`)
      - traefik.http.routers.dashboard.entrypoints=websecure
      - traefik.http.routers.dashboard.service=api@internal
      - traefik.http.routers.dashboard.middlewares=secure-auth
      - traefik.http.middlewares.secure-auth.basicauth.users=${BASIC_AUTH}

traefik_dynamic.yml content:

http:
  middlewares:
    https-only:
      redirectScheme:
        scheme: https

    dashboard-auth:
      basicAuth:
        users:
          - '${BASIC_AUTH}'

My problem is that whenever I access any address on the domain, it takes almost a minute to load.

I've already tried monitoring the logs (docker logs traefik --timestamps -f) but haven't found anything helpful. It only displays the request log itself.

Any tips on what might be wrong or any additional logs I could review to try and find the cause of the slowness?

Sounds like a network issue. Is the domain pointing to an external IP?

You could run whoami directly on port 80 and access it the same way, to see if it has the same network delay.

Tks for your reply. I’ve made more tests and, for now, I am assuming that my problem is with Cloudflare. Until few weeks ago I am using some free domain on No-IP. When I create a domain and migrate my DDNS to Cloudflare, the problems started. As I start to use Traefik on the same time, I was assuming that it was the problem, but the access with No-IP free domain steel working fine.

Now I need to choose another DDNS service to made more tests.