{
"apps": {
"http": {
"http_port": 6080,
"https_port": 6443,
"servers": {
"srv0": {
"listen": [
":6080"
],
"routes": [
{
"match": [
{
"host": [
"site1"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.0.10:80"
}
]
}
]
}
]
}
],
"terminal": true
},
{
"match": [
{
"host": [
"site2"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.0.20:80"
}
]
}
]
}
]
}
],
"terminal": true
},
{
"match": [
{
"host": [
"site3"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.0.30:80"
}
]
}
]
}
]
}
],
"terminal": true
}
]
},
"srv1": {
"listen": [
":6443"
],
"routes": [
{
"match": [
{
"host": [
"site1"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.0.10:80"
}
]
}
]
}
]
}
],
"terminal": true
},
{
"match": [
{
"host": [
"site2"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.0.20:80"
}
]
}
]
}
]
}
],
"terminal": true
},
{
"match": [
{
"host": [
"site3"
]
}
],
"handle": [
{
"handler": "subroute",
"routes": [
{
"handle": [
{
"handler": "reverse_proxy",
"upstreams": [
{
"dial": "10.0.0.30:80"
}
]
}
]
}
]
}
],
"terminal": true
}
],
"tls_connection_policies": [
{
"match": {
"sni": [
"site1"
]
},
"client_authentication": {
"mode": "request"
}
},
{}
]
}
}
},
"tls": {
"automation": {
"policies": [
{
"subjects": [
"site1"
],
"issuers": [
{
"module": "internal"
}
]
},
{
"subjects": [
"site2"
],
"issuers": [
{
"module": "internal"
}
]
},
{
"subjects": [
"site3"
],
"issuers": [
{
"module": "internal"
}
]
}
]
}
}
}
}
bash-5.2$ caddy validate --config caddy.json
2023/03/29 14:30:05.033 INFO using provided configuration {"config_file": "caddy.json", "config_adapter": ""}
2023/03/29 14:30:05.033 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000200bd0"}
2023/03/29 14:30:05.118 WARN http server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 6080}
2023/03/29 14:30:05.118 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv1"}
2023/03/29 14:30:05.119 WARN http enabling strict SNI-Host enforcement because TLS client auth is configured {"server_id": "srv1"}
2023/03/29 14:30:05.119 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000200bd0"}
Valid configuration
bash-5.2$ caddy validate --config caddy.json
2023/03/29 14:30:27.927 INFO using provided configuration {"config_file": "caddy.json", "config_adapter": ""}
2023/03/29 14:30:27.927 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000388e00"}
2023/03/29 14:30:27.928 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv1"}
2023/03/29 14:30:27.928 WARN http server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 6080}
2023/03/29 14:30:27.928 WARN http enabling strict SNI-Host enforcement because TLS client auth is configured {"server_id": "srv1"}
2023/03/29 14:30:27.928 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000388e00"}
Valid configuration
bash-5.2$ caddy validate --config caddy.json
2023/03/29 14:31:02.214 INFO using provided configuration {"config_file": "caddy.json", "config_adapter": ""}
2023/03/29 14:31:02.215 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000314e00"}
2023/03/29 14:31:02.215 WARN http server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 6080}
2023/03/29 14:31:02.215 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv1"}
2023/03/29 14:31:02.215 WARN http enabling strict SNI-Host enforcement because TLS client auth is configured {"server_id": "srv1"}
2023/03/29 14:31:02.215 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000314e00"}
Valid configuration
bash-5.2$ caddy validate --config caddy.json
2023/03/29 14:31:15.951 INFO using provided configuration {"config_file": "caddy.json", "config_adapter": ""}
2023/03/29 14:31:15.952 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000342d90"}
2023/03/29 14:31:15.952 WARN http server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 6080}
2023/03/29 14:31:15.952 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv1"}
2023/03/29 14:31:15.953 WARN http enabling strict SNI-Host enforcement because TLS client auth is configured {"server_id": "srv1"}
2023/03/29 14:31:15.953 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000342d90"}
Valid configuration
bash-5.2$ caddy validate --config caddy.json
2023/03/29 14:31:31.566 INFO using provided configuration {"config_file": "caddy.json", "config_adapter": ""}
2023/03/29 14:31:31.567 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0xc000218770"}
2023/03/29 14:31:31.568 WARN http server is listening only on the HTTP port, so no automatic HTTPS will be applied to this server {"server_name": "srv0", "http_port": 6080}
2023/03/29 14:31:31.568 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv1"}
2023/03/29 14:31:31.568 WARN http enabling strict SNI-Host enforcement because TLS client auth is configured {"server_id": "srv1"}
2023/03/29 14:31:31.568 INFO tls.cache.maintenance stopped background certificate maintenance {"cache": "0xc000218770"}
Valid configuration
bash-5.2$ caddy run --watch config caddy.json
2023/03/29 14:31:46.554 INFO using adjacent Caddyfile
Error: adapting config using caddyfile: ambiguous site definition: :6080