i am running same laravel 9 application on 2 differnet docker containers, applicaton has two routes when i acccess http://localhost/container1 and http://localhost/container2, what i want is to route to different container when i use /container1 and /container2, i am using traefik reverse proxy

version: '3'

services: traefik: image: traefik:v2.3.6 restart: always command: - --accesslog - --api.insecure=true - --providers.docker - --providers.docker.exposedbydefault=false volumes: - /var/run/docker.sock:/var/run/docker.sock networks: - frontend ports: - 80:80 - 8080:8080

container1: build: context: ./ dockerfile: Dockerfile1 labels: - traefik.enable=true - traefik.http.routers.container1.rule=Host(localhost) && Path(/v1/container1) - traefik.http.routers.container1.tls=false networks: - frontend expose: - 8081

container2: build: context: ./ dockerfile: Dockerfile2 labels: - traefik.enable=true - traefik.http.routers.container2.rule=Host(localhost) && Path(/v1/container2) - traefik.http.routers.container2.tls=false networks: - frontend expose: - 8082

volumes: volum: networks: frontend: driver: bridge

/r/docker Thread Parent