2023-08-13 16:50:38 +02:00
|
|
|
(app-redir) {
|
2023-08-15 17:57:38 +02:00
|
|
|
@redirect {
|
|
|
|
expression `{http.request.host.labels.2} != "{args[0]}"`
|
|
|
|
}
|
|
|
|
redir @redirect https://{args[0]}.zio.sh{uri} temporary
|
2023-08-13 16:50:38 +02:00
|
|
|
}
|
|
|
|
|
2023-08-12 23:03:33 +02:00
|
|
|
(cors) {
|
2023-08-15 17:57:38 +02:00
|
|
|
@origin header Origin {args[0]}
|
|
|
|
header @origin Access-Control-Allow-Origin "{args[0]}"
|
2023-08-12 23:03:33 +02:00
|
|
|
header @origin Access-Control-Request-Method GET
|
|
|
|
}
|
|
|
|
|
2023-08-13 00:48:56 +02:00
|
|
|
(homedir) {
|
|
|
|
@user_home path_regexp user ^/~([^/]+)(/.*)?$
|
|
|
|
handle @user_home {
|
|
|
|
redir /~{re.user.1} /~{re.user.1}/ permanent
|
2023-08-15 17:57:38 +02:00
|
|
|
root * {args[0]}{re.user.1}/www
|
2023-08-13 00:48:56 +02:00
|
|
|
rewrite * {re.user.2}
|
|
|
|
file_server browse {
|
|
|
|
hide .[A-Za-z]*
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-12 23:03:33 +02:00
|
|
|
(nobots) {
|
|
|
|
respond /robots.txt 200 {
|
|
|
|
body "User-agent: *
|
|
|
|
Disallow: /"
|
|
|
|
close
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
(tls-cf) {
|
|
|
|
tls {
|
2023-08-15 17:57:38 +02:00
|
|
|
dns cloudflare {args[0]}
|
2023-08-12 23:03:33 +02:00
|
|
|
resolvers 1.1.1.1
|
|
|
|
}
|
|
|
|
}
|
2023-08-15 17:57:38 +02:00
|
|
|
|