# Traefik2 route multiple services to multiple subpaths in flask

**URL:** <https://community.traefik.io/t/traefik2-route-multiple-services-to-multiple-subpaths-in-flask/4790>\
**Category:** Traefik v2\
**Tags:** rest-api, docker\
**Created:** [March 6, 2020, 9:07am UTC](https://community.traefik.io/t/traefik2-route-multiple-services-to-multiple-subpaths-in-flask/4790 "2020-03-06T09:07:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![elepherai](https://avatars.discourse-cdn.com/v4/letter/e/eb9ed0/32.png) [@elepherai](https://community.traefik.io/u/elepherai)\
**Post date:** [March 6, 2020, 9:07am UTC](https://community.traefik.io/t/traefik2-route-multiple-services-to-multiple-subpaths-in-flask/4790/1 "2020-03-06T09:07:21Z")

</div>

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.

```auto
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"

```
