Traefik2 route multiple services to multiple subpaths in flask

I have an issue with multiple services running by flask.

If I comment service app1 or app2, everything works great.

But when I run two sevicves simultaneously and "curl localhost/app1", I got 404 error.

"curl localhost/app2" works great.

Here's the docker-compose.yml.

version: "2.4"

services:

  traefik:
    image: "traefik:v2.1.3"
    container_name: "traefik"
    command:
      #- "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

  app1:
    image: pytorch:1.4.0
    build:
      context: .
      target: prod
      dockerfile: ./app1/Dockerfile
    labels:
      - traefik.enable=true
      - "traefik.http.routers.app1.rule=Path(`/app1`)"
      - "traefik.http.routers.app1.entrypoints=web"

  app2:
    image: pytorch:1.4.0
    build:
      context: .
      target: prod
      dockerfile: ./app2/Dockerfile
    labels:
      - traefik.enable=true
      - "traefik.http.routers.app2.rule=Path(`/app2`)"
      - "traefik.http.routers.app2.entrypoints=web"