mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
move
This commit is contained in:
parent
f456a5c626
commit
0949cba7be
92 changed files with 19 additions and 58 deletions
59
nix/modules/caddy/base.Caddyfile
Normal file
59
nix/modules/caddy/base.Caddyfile
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue