Got it working! started from scratch converting json from Caddyfile and working my way from there. Not sure if this is the best way to do it or not, but it works. Please let me know if there is a better way / anything you would change.
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [":443"],
"routes": [
{
"match": [
{
"host": ["workspace.xincept.xyz"]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.18.0.1:3010"
}
]
}
]
}
]
}
],
"terminal": true
},
{
"match": [
{
"host": ["books.xincept.xyz"]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.18.0.1:50224"
}
]
}
]
}
]
}
],
"terminal": true
},
{
"match": [
{
"host": ["air.xincept.xyz"]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "172.18.0.1:50212"
}
]
}
]
}
]
}
],
"terminal": true
}
],
"tls_connection_policies": [
{
"match": {
"sni": ["workspace.xincept.xyz"]
},
"certificate_selection": {
"any_tag": ["cert0"]
}
},
{
"match": {
"sni": ["air.xincept.xyz"]
},
"certificate_selection": {
"any_tag": ["cert0"]
}
},
{}
],
"automatic_https": {
"ignore_loaded_certificates": true,
"skip_certificates": ["workspace.xincept.xyz", "air.xincept.xyz"]
}
}
}
},
"tls": {
"certificates": {
"load_files": [
{
"certificate": "/certs/xincept.xyz.pem",
"key": "/certs/xincept.xyz.key",
"tags": [
"cert0"
]
}
]
},
"automation": {
"policies": [
{
"subjects": ["books.xincept.xyz"],
"issuers": [
{
"module": "acme",
"ca": "https://acme-v02.api.letsencrypt.org/directory"
}
]
}
]
}
}
}
}
logs
{"level":"info","ts":1729055936.0640512,"msg":"using config from file","file":"/etc/caddy/caddy.json"}
{"level":"info","ts":1729055936.065546,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//localhost:2019","//[::1]:2019","//127.0.0.1:2019"]}
{"level":"info","ts":1729055936.0660672,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc000710480"}
{"level":"warn","ts":1729055936.066854,"logger":"tls","msg":"stapling OCSP","error":"no OCSP stapling for [cloudflare origin certificate *.xincept.xyz xincept.xyz]: no URL to issuing certificate"}
{"level":"info","ts":1729055936.0674977,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1729055936.0680542,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
{"level":"info","ts":1729055936.0682201,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
{"level":"info","ts":1729055936.0682592,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
{"level":"info","ts":1729055936.0682673,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["books.xincept.xyz"]}
{"level":"info","ts":1729055936.069549,"msg":"autosaved config (load with --resume flag)","file":"/config/caddy/autosave.json"}
{"level":"info","ts":1729055936.0695574,"msg":"serving initial configuration"}
{"level":"info","ts":1729055936.0703018,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/data/caddy","instance":"909323ff-c7fe-438d-bdba-427a3e9cea1b","try_again":1729142336.0703,"try_again_in":86399.999999636}
{"level":"info","ts":1729055936.0703957,"logger":"tls","msg":"finished cleaning storage units"}