Erro on starting Traefik mapping values are not allowed in this context, I am going super sayan mode

Hey, I do have this error while starting traefik:
level=error msg="Error while building configuration (for the first time): yaml: line 50: mapping values are not allowed in this context" providerName=file

The next error is:
level=error msg="middleware \"secureHeaders@file\" does not exist" entryPointName=websecure routerName=traefik-secure@docker

This is my static configuration

log:
  level: DEBUG

api:
  dashboard: true

entryPoints:
  web:
    address: :80
    http:
      redirections:
        entryPoint:
          to: websecure
  
  websecure:
    address: :443
    http:
      middlewares:
        - secureHeaders@file
      tls:
        certResolver: cloudflare
        domains:
          - main: 'example.com'
            sans:
            - '*.example.com'

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false
    network: traefik
  file:
    filename: "/etc/traefik/dynamic.yml"

certificatesResolvers:
  cloudflare:
    acme:
      email: email@example.com
      storage: acme.json
      dnsChallenge:
        provider: cloudflare

My docker compose file

version: "2.2"
services:
  traefik:
    image: traefik:2.10
    container_name: traefik
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - traefik
    ports:
      - 80:80
      - 443:443
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro 
      - ./config/traefik.yml:/etc/traefik/traefik.yml:ro  
      - ./config/dynamic.yml:/etc/traefik/dynamic.yml:ro  
      - ./config/acme.json:/etc/traefik/acme.json  
    environment:
      - CF_API_EMAIL= xxx
      - CF_DNS_API_TOKEN= xxx
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik-secure.entrypoints=websecure"
      - "traefik.http.routers.traefik-secure.tls=true"
      - "traefik.http.routers.traefik-secure.rule=Host(`traefik.example.com`)"
      - "traefik.http.routers.traefik-secure.service=api@internal"
      - "traefik.http.routers.traefik-secure.middlewares=user-auth@file"       

networks:
  traefik:
    external: true
    name: traefik

I am going insane, why do I keep getting theese errors.
My syntax match the official documentation

Can anybody please give me some advice?
Maybe I am blind and what I need is another point of view

Thank you

I expect the error in your dynamic config:

This is my dynamic config

http:
  routers:
    gitea-route:
      entryPoints:
      - websecure
      rule: Host("gitea.example.com")
      service: gitea

  services:
    gitea:
      loadBalancer:
        servers:
        - url: "http://ipaddress:3000"

  middlewares:
    secureHeaders:
      headers:
        sslRedirect: true
        forceSTSHeader: true
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 31536000
  
    customHeaders:
      headers:
        browserXssFilter: true
        contentTypeNosniff: true
        customFrameOptionsValue: "SAMEORIGIN"
        customRequestHeaders:
          X-Forwarded-Proto: "https"
        stsIncludeSubdomains: true
        stsPreload: true
        stsSeconds: 31536000

tls:
  options:
    default:
      cipherSuites:
        - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
        - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
        - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
        - TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
        - TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305
        - TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
      minVersion: VersionTLS12

I can't see what could be causing theese errors event looking at my dynamic config :cry:

Something does not check out, as both yml files you have posted have less than 50 lines.

I found out what it was, a silly problem, as I imagined.

I was editing theese files with nano trough an ssh tunnel from wsl... apparently there was some kind of quirks in the files doing so.

Opening them via studio code and saving them again solved the problem....

Thank you blupuma77 for your support