Hello, currently I own or heavily manage multiple services, however we did a server transition and the issue with this is I need to redo everything. The caddy config im having issues figuring out, however i have split it into multiple configs like this, each with their own on demand TLS server and more. Im running into issues with SSL not being given for my servers. I reach my users by allowing them to attach their own domains to my servers so they may have their own copy. Here is one of my example configurations.
Configuration:
{
email <email>
on_demand_tls {
ask http://localhost:5555
}
}
# Space
<ip> {
tls {
on_demand
}
@wisp {
path /wisp/
}
reverse_proxy @wisp localhost:4040
reverse_proxy http://localhost:6060
encode gzip
}
PM2 - Caddy logs
root@space:~/caddyfiles# pm2 logs 5
[TAILING] Tailing last 15 lines for [5] process (change the value with --lines option)
/root/.pm2/logs/caddy4space-out.log last 15 lines:
/root/.pm2/logs/caddy4space-error.log last 15 lines:
5|caddy4sp | {"level":"info","ts":1728340981.2378995,"msg":"using config from file","file":"space.caddyfile"}
5|caddy4sp | {"level":"info","ts":1728340981.2387748,"msg":"adapted config to JSON","adapter":"caddyfile"}
5|caddy4sp | {"level":"warn","ts":1728340981.2387884,"msg":"Caddyfile input is not formatted; run 'caddy fmt --overwrite' to fix inconsistencies","adapter":"caddyfile","file":"space.caddyfile","line":2}
5|caddy4sp | {"level":"info","ts":1728340981.2391982,"logger":"admin","msg":"admin endpoint started","address":"localhost:2019","enforce_origin":false,"origins":["//127.0.0.1:2019","//localhost:2019","//[::1]:2019"]}
5|caddy4sp | {"level":"info","ts":1728340981.2392948,"logger":"http.auto_https","msg":"server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS","server_name":"srv0","https_port":443}
5|caddy4sp | {"level":"info","ts":1728340981.2393022,"logger":"http.auto_https","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
5|caddy4sp | {"level":"info","ts":1728340981.2393682,"logger":"tls.cache.maintenance","msg":"started background certificate maintenance","cache":"0xc00059b580"}
5|caddy4sp | {"level":"info","ts":1728340981.2395751,"logger":"http.log","msg":"server running","name":"remaining_auto_https_redirects","protocols":["h1","h2","h3"]}
5|caddy4sp | {"level":"info","ts":1728340981.2395947,"logger":"http","msg":"enabling HTTP/3 listener","addr":":443"}
5|caddy4sp | {"level":"info","ts":1728340981.239723,"logger":"http.log","msg":"server running","name":"srv0","protocols":["h1","h2","h3"]}
5|caddy4sp | {"level":"info","ts":1728340981.2397282,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["104.243.38.145"]}
5|caddy4sp | {"level":"info","ts":1728340981.2398345,"msg":"autosaved config (load with --resume flag)","file":"/root/.config/caddy/autosave.json"}
5|caddy4sp | {"level":"info","ts":1728340981.2398393,"msg":"serving initial configuration"}
5|caddy4sp | {"level":"info","ts":1728340981.2569785,"logger":"tls","msg":"storage cleaning happened too recently; skipping for now","storage":"FileStorage:/root/.local/share/caddy","instance":"2cdb736c-155d-4723-a2b4-e51f919577a5","try_again":1728427381.2569761,"try_again_in":86399.99999964}
5|caddy4sp | {"level":"info","ts":1728340981.2570758,"logger":"tls","msg":"finished cleaning storage units"}
How can I make it so it’ll serve and assign different things to any domain connected to the IPs based on what IP it is, as I know bind isn’t a thing anymore. Also I will be serving more than one thing, so the ability to make it work with any domain based on IP would be wonderful.