mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
59 lines
1 KiB
Caddyfile
59 lines
1 KiB
Caddyfile
{
|
|
email noratrieb@proton.me
|
|
auto_https disable_redirects
|
|
|
|
storage s3 {
|
|
host "localhost:3900"
|
|
bucket "caddy-store"
|
|
# access_id ENV S3_ACCESS_ID
|
|
# secret_key ENV S3_SECRET_KEY
|
|
|
|
insecure true
|
|
}
|
|
|
|
servers {
|
|
metrics
|
|
}
|
|
|
|
log default {
|
|
output stdout
|
|
format json
|
|
}
|
|
}
|
|
|
|
# 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
|
|
}
|
|
}
|
|
}
|
|
|
|
http:// {
|
|
log
|
|
respond "This is an HTTPS-only server, silly you. Go to https:// instead." 418
|
|
}
|
|
|
|
# HTTP
|
|
:9010 {
|
|
log
|
|
metrics /metrics
|
|
}
|