This commit is contained in:
nora 2023-08-27 17:07:08 +02:00
parent f53902abee
commit e714c08de3
10 changed files with 71 additions and 13 deletions

34
vps1/Caddyfile Normal file
View file

@ -0,0 +1,34 @@
{
email nilstrieb@gmail.com
}
# https://gist.github.com/ryanburnette/d13575c9ced201e73f8169d3a793c1a3
(cors) {
@cors_preflight{args.0} method OPTIONS
@cors{args.0} header Origin {args.0}
handle @cors_preflight{args.0} {
header {
Access-Control-Allow-Origin "{args.0}"
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS"
Access-Control-Allow-Credentials "false"
Access-Control-Allow-Headers "${args.1}"
Access-Control-Max-Age "86400"
defer
}
respond "" 204
}
handle @cors{args.0} {
header {
Access-Control-Allow-Origin "{args.0}"
Access-Control-Expose-Headers *
defer
}
}
}
vps1.nilstrieb.dev {
root * /var/www/html/debug
file_server
}