i have this kind of fs:
dist app1 (docker-compose) app2 (docker-compose) app3 (docker-compose)
app1, app2, app3 are the same containerized app like:
services:
services1:
build:
context: ./services1/
env_file:
- .env
command: npm run start
services2:
build:
context: ./services2/
env_file:
- .env
command: npm run start
app1, app2, app3 are backend for different clients but they are exactly the same app, and... they run on the same port.
My problem is: How can use a Caddyfile to redirect to my backends like:
subapp1.app1.domain.io {
reverse_proxy app1_subapp1
}
subapp2.app1.domain.io {
reverse_proxy app1_subapp2
}
subapp1.app2.domain.io {
reverse_proxy app2_subapp1
}
subapp2.app2.domain.io {
reverse_proxy app2_subapp2
}
I tried to use external network approach, but... not very handy. I suppose my case is not very rare... do you have any suggestions, advice ?
Thx !