mirror of
https://github.com/Noratrieb/vps.git
synced 2026-03-14 21:26:08 +01:00
Compare commits
2 commits
ac0860cd05
...
d392369473
| Author | SHA1 | Date | |
|---|---|---|---|
| d392369473 | |||
| c5ec691a7c |
2 changed files with 15 additions and 23 deletions
|
|
@ -62,35 +62,27 @@ in
|
|||
"api.hugo-chat.noratrieb.dev" =
|
||||
let
|
||||
cors = pkgs.writeText "cors" ''
|
||||
# https://gist.github.com/ryanburnette/d13575c9ced201e73f8169d3a793c1a3
|
||||
@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
|
||||
@cors_preflight {
|
||||
method OPTIONS
|
||||
header Origin *
|
||||
}
|
||||
|
||||
handle @cors{args[0]} {
|
||||
handle @cors_preflight {
|
||||
header {
|
||||
Access-Control-Allow-Origin "{args[0]}"
|
||||
Access-Control-Expose-Headers *
|
||||
defer
|
||||
Access-Control-Allow-Origin "*"
|
||||
Access-Control-Allow-Methods "*"
|
||||
Access-Control-Allow-Headers "content-type"
|
||||
}
|
||||
respond 204
|
||||
}
|
||||
|
||||
|
||||
'';
|
||||
in
|
||||
{
|
||||
logFormat = "";
|
||||
extraConfig = ''
|
||||
import ${cors} https://hugo-chat.noratrieb.dev "DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type"
|
||||
import ${cors}
|
||||
encode zstd gzip
|
||||
reverse_proxy * localhost:5001
|
||||
'';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"nixos-25.05": {
|
||||
"lastUpdated": "2025-12-22T11:35:31.967Z",
|
||||
"commit": "2b0d2b456e4e8452cf1c16d00118d145f31160f9"
|
||||
"lastUpdated": "2026-01-31T13:55:04.757Z",
|
||||
"commit": "ac62194c3917d5f474c1a844b6fd6da2db95077d"
|
||||
},
|
||||
"nixos-25.11": {
|
||||
"lastUpdated": "2025-12-22T11:35:32.154Z",
|
||||
"commit": "b3aad468604d3e488d627c0b43984eb60e75e782"
|
||||
"lastUpdated": "2026-01-31T13:55:04.922Z",
|
||||
"commit": "fa83fd837f3098e3e678e6cf017b2b36102c7211"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue