2
0
Fork 0

caddy: add homedir snippet

main
Ducky 2023-08-12 23:48:56 +01:00
parent 4d41f1e92f
commit 636ca435c2
1 changed files with 12 additions and 0 deletions

View File

@ -4,6 +4,18 @@
header @origin Access-Control-Request-Method GET 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) { (nobots) {
respond /robots.txt 200 { respond /robots.txt 200 {
body "User-agent: * body "User-agent: *