couchdb: added support for CORS

This commit is contained in:
Tigor Hutasuhut 2024-10-16 16:37:31 +07:00
parent 4d7fa35273
commit 4ea9b683d5

View file

@ -39,6 +39,14 @@ in
}; };
services.caddy.virtualHosts."couchdb.tigor.web.id".extraConfig = '' 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 reverse_proxy localhost:5984
''; '';