nextcloud: ajout CORS pour wiki

nextcloud
Pyjacpp 2026-08-03 19:01:31 +02:00
parent 760b14b795
commit 932e7ecc17
No known key found for this signature in database
GPG Key ID: ED479A5A26930939
1 changed files with 13 additions and 0 deletions

View File

@ -52,4 +52,17 @@
appstoreEnable = true;
extraAppsEnable = true;
};
# Activation CORS pour récuppérer les agendas depuis le wiki
services.nginx.virtualHosts.${config.services.nextcloud.hostName}.locations."~* /remote.php/dav/public-calendars/[a-z]+\?export".extraConfig =
''
add_header 'Access-Control-Allow-Origin' 'https://mediawiki.crans.org' always;
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 86400;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
'';
}