2
0
Fork 0
rootfs/etc/caddy/snippets.caddyfile

51 lines
1.0 KiB
Plaintext

(app-redir) {
@redirect {
expression `{http.request.host.labels.2} != "{args[0]}"`
}
redir @redirect https://{args[0]}.zio.sh{uri} temporary
}
(cors) {
@origin header Origin {args[0]}
header @origin Access-Control-Allow-Origin "{args[0]}"
header @origin Access-Control-Request-Method GET
}
(homedir) {
@user_home path_regexp user ^/~([^/]+)(/.*)?$
handle @user_home {
redir /~{re.user.1} /~{re.user.1}/ permanent
root * {args[0]}{re.user.1}/www
rewrite * {re.user.2}
file_server browse {
hide .[A-Za-z]*
}
}
}
(nobots) {
respond /robots.txt 200 {
body "User-agent: *
Disallow: /"
close
}
}
(tls-cf) {
tls {
dns cloudflare {args[0]}
resolvers 1.1.1.1
}
}
(fuckbots) {
@fuckbots {
header_regexp User-Agent "(Barkrowler|GoogleOther|Googlebot|Amazonbot|PetalBot|bingbot|YandexBot)"
header Host git.zio.sh
}
handle @fuckbots {
respond Gone 410
}
}