1. The problem I’m having:
I’m using docker compose with asp net app and caddy
My config:
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "constests:4000/contest/examplecontest"
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"examplecontest.com"
]
}
],
"terminal": true
}
I want that if a user goes to the examplecontest.com site it will be proxied through constests:4000/contest/examplecontest, but it doesn’t seem to work.
How can this be fixed? The point is that I need to dynamically bind domains to a specific path via the api on the site
2. Error messages and/or full log output:
"msg":"dial tcp: lookup contest/examplecontest: no such host"
"err_trace":"reverseproxy.statusError (reverseproxy.go:1248)"
3. Caddy version:
2.7.4
4. How I installed and ran Caddy:
Via Docker compose
a. System environment:
Docker
b. Command:
c. Service/unit/compose file:
d. My complete Caddy config:
{
"admin": {
"listen": ":2019"
},
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "contestgenerator:5000"
}
]
}
]
}
]
}
],
"match": [
{
"host": [
"contestcreator.com"
]
}
],
"terminal": true
},
{
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "contestgenerator:5000/contest/MZVPC_1234:80"
},
]
}
]
}
]
}
],
"match": [
{
"host": [
"examplecontest.com"
]
}
],
"terminal": true
}
]
}
}
}
}
}