Traefik v2.5 no redirecting to portainer portal

Hello,

the problem is related to the path.

A working example without a path
version: '3.7'

services:

  reverse-proxy:
    image: traefik:v2.5.4
    command:
      - --log.level=INFO
      - --api.insecure
      - --api.dashboard
      - --entrypoints.web.address=:80
      - --providers.docker.exposedbydefault=false
    container_name: traefik
    networks:
      - traefik_net
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"

  portainer:
    image: portainer/portainer-ce:2.9.1-alpine
    container_name: portainer
    networks:
      - traefik_net
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
      - portainer_data:/data"
    labels:
      traefik.enable: "true"
      traefik.http.routers.portainer.entrypoints: web
      traefik.http.routers.portainer.rule: Host(`portainer.localhost`)
      # traefik.http.routers.portainer.rule: Host(`localhost`) && PathPrefix(`/portainer`)
      traefik.http.services.portainer.loadbalancer.server.port: 9000

networks:
  traefik_net: {}
volumes:
  portainer_data:

Portainer doesn't really support a subpath.