entryPoint middleware - RedirectRegex not working

I have simplified my redirectRegex but still im not getting any redirect form my config at all. I have been staring at this for so long im going crazy. The TRACE logs are of no help. There has to be a config error, but im to novice to see it.

Config File:

entryPoints:
  http:
    address: :80
    http:
      redirections:
        entryPoint:
          to: https
          scheme: https
          permanent: true
    forwardedHeaders:
      trustedIPs:
        - 127.0.0.1/32
        - 192.168.0.0/16
        - 172.16.0.0/12
        - 10.0.0.0/8
  https:
    address: :443
    http:
      tls:
        certResolver: letsencrypt
        domains:
          - main: zotti.us
            sans: "*.zotti.us"
          - main: cystemdown.com
            sans: "*.cystemdown.com"
      middlewares:
        - cystemdown-redirect@file
    forwardedHeaders:
      trustedIPs:
        - 127.0.0.1/32
        - 192.168.0.0/16
        - 172.16.0.0/12
        - 10.0.0.0/8
http:
  middlewares:
    cystemdown-redirect:
      redirectRegex:
        regex: "^https://t-proxy.cystemdown.com/(.*)"  # Match URLs like 'subdomain.cystemdown.com'
        replacement: "https://t-proxy.zotti.us$1"  # Replace with 'subdomain.zotti.us'
        permanent: true  # Use a permanent redirect (301)
tls:
  options:
    default:
      minVersion: VersionTLS12

serversTransport:
    insecureSkipVerify: false
certificatesResolvers:
  letsencrypt:
    acme:
      email: admin@zotti.us
      caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
      #caServer: "https://acme-v02.api.letsencrypt.org/directory"
      storage: /var/traefik/certs/cloudflare-acme.json
      dnsChallenge:
        provider: cloudflare
        resolvers:
          - "1.1.1.1:53"
          - "1.0.0.1:53"
providers:
  docker:
    exposedByDefault: false
  file:
    directory: /etc/traefik
    watch: true

log:
  level: TRACE # - level: [TRACE, DEBUG, INFO, WARN, ERROR, FATAL]
  format: common
#  filePath: /var/log/traefik/traefik.log

#accesslog:
#   format: common
#   filePath: /var/log/traefik/access.log
api:
  dashboard: true
  disableDashboardAd: true
  insecure: false

global:
  checkNewVersion: false
  sendAnonymousUsage: false

DockerCompose:

services:
  traefik:
    image: docker.io/library/traefik:v3.2.0
    container_name: traefik-proxy
    restart: unless-stopped
    networks:
      SERVER-NAT:
      SERVER-L2:
        ipv4_address: 10.40.1.51
    ports:
      - 80:80
      - 443:443
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data/traefik.yml:/etc/traefik/traefik.yaml:ro
      - ./data/configs:/etc/traefik/conf.d/:ro
      - letsencrypt:/var/traefik/certs/:rw
      - ./data/logs:/logs:rw
    environment:
      - TZ=$TZ
      - CF_DNS_API_TOKEN=${CFAPI}
    labels:
      - traefik.enable=true
      - traefik.http.routers.traefik-https.service=api@internal
      - traefik.http.routers.traefik-https.rule=Host(`t-proxy.zotti.us`)
      - traefik.http.middlewares.traefik-auth.basicauth.users=${TRAEFIKADMIN}
      - traefik.http.routers.traefik-https.middlewares=traefik-auth
    read_only: true
    security_opt:
      - no-new-privileges=true
networks:
  SERVER-L2:
    external: true
  SERVER-NAT:
    external: true

volumes:
  letsencrypt:
    name: letsencrypt

For sanity, I did check that Im hitting the proxy, but im just getting a 404 and no redirect at all.

I would say you need a router. Doc states:

The list of middlewares that are prepended by default to the list of middlewares of each router associated to the named entry point.

But without a matching router you never get to the middleware stage.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.