From 4ea9b683d512c9d1840d6d530685a9fedb59cd6f Mon Sep 17 00:00:00 2001 From: Tigor Hutasuhut Date: Wed, 16 Oct 2024 16:37:31 +0700 Subject: [PATCH] couchdb: added support for CORS --- system/services/couchdb.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/system/services/couchdb.nix b/system/services/couchdb.nix index 0157005..e3bb7a0 100644 --- a/system/services/couchdb.nix +++ b/system/services/couchdb.nix @@ -39,6 +39,14 @@ in }; services.caddy.virtualHosts."couchdb.tigor.web.id".extraConfig = '' + @origin header Origin {args[0]} + header @origin { + Access-Control-Allow-Origin "{args[0]}" + Access-Control-Allow-Methods "OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE" + } + @options method OPTIONS + respond @options 204 + reverse_proxy localhost:5984 '';