1. Output of caddy version
:
v2.6.1 h1:EDqo59TyYWhXQnfde93Mmv4FJfYe00dO60zMiEt+pzo=
2. How I run Caddy:
a. System environment:
amazon linux 2
b. Command:
caddy run --config caddyfile.json
d. My complete Caddy config:
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443",
":80"
],
"routes": [
{
{
"handler":"encode",
"encodings":{"gzip":{},"zstd":{}},
"prefer":["zstd","gzip"]
},
{
"handler": "reverse_proxy",
"dynamic_upstreams":
{
"source":"srv",
"service":"_wg",
"proto":"tcp",
"name":"{host}",
"refresh":"10m",
"dial_timeout":"4s"
},
}
]
}
],
"tls_connection_policies": [
{}
]
}
}
},
"tls": {
"automation": {
"policies": [
{
"issuers": [
{
"email": "[redacted]",
"module": "acme"
},
{
"email": "[redacted],
"module": "zerossl"
}
],
"on_demand": true
}
],
"on_demand": {
"ask": "http://10.50.1.11/.check"
}
}
}
},
"storage": {
"module": "file_system",
"root": "/var/caddy"
}
}
3. The problem I’m having:
Host is not being resolved by composing the srv record request with service+proto+name when used with placeholder as name with error shown below:
2022/09/22 16:17:59.925 ERROR http.handlers.reverse_proxy failed getting dynamic upstreams; falling back to static upstreams {"error": "lookup __wg._tcp. on 172.26.0.2:53: dial tcp 174.129.251.171:0: i/o timeout"}
4. Error messages and/or full log output:
2022/09/22 16:17:59.925 ERROR http.handlers.reverse_proxy failed getting dynamic upstreams; falling back to static upstreams {"error": "lookup __wg._tcp. on 172.26.0.2:53: dial tcp 174.129.251.171:0: i/o timeout"}