1. The problem I’m having:
I have the following Caddyfile and i’d like to know if it’s good/bad to use snippets like this and if there’s anything i can improve in terms of security
It all generally works like i want it to, so i’ve removed most of the template.
d. My complete Caddy config:
{
email mail@mail.mail
}
(public) {
@{args[0]}-host host {args[0]}.mytotallyrealdomain.com
handle @{args[0]}-host {
reverse_proxy {args[1]}
}
}
(private) {
@{args[0]}-host host {args[0]}.mytotallyrealdomain.com
handle @{args[0]}-host {
reverse_proxy {args[1]}
@{args[0]}-denied not remote_ip private_ranges
abort @{args[0]}-denied
}
}
*.mytotallyrealdomain.com, mytotallyrealdomain.com
tls {
dns cloudflare token123
}
import public foo 192.168.0.2:1234
# ... many more of these lines
import private bar 192.168.0.2:5678
# ... many more of these lines too
@home host mytotallyrealdomain.com
handle @home {
header Content-Type text/html
respond <<HTML
<html>
<p>some custom html :)</p>
</html>
HTML 200
}
handle {
abort
}