mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-14 16:55:00 +01:00
setup vps1 ingress
This commit is contained in:
parent
d925b4783e
commit
03c4ca2f95
5 changed files with 109 additions and 6 deletions
29
newinfra/nix/modules/ingress/Caddyfile
Normal file
29
newinfra/nix/modules/ingress/Caddyfile
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
email nilstrieb@proton.me
|
||||
}
|
||||
|
||||
# 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
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue