From 84c0fc2e5970f7db033ca53152ce729a03cfb7a3 Mon Sep 17 00:00:00 2001 From: Wang Guan Date: Thu, 18 Sep 2025 17:44:24 +0000 Subject: [PATCH] nginx: add CORS for /storage --- nginx/templates/default.conf.template | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nginx/templates/default.conf.template b/nginx/templates/default.conf.template index afa016c..17669fa 100644 --- a/nginx/templates/default.conf.template +++ b/nginx/templates/default.conf.template @@ -31,6 +31,14 @@ server { if ($request_filename ~* ^.*?\.(txt|zip)$){ add_header Content-Disposition "attachment;"; } + + # Uncomment the following lines to allow CORS + # add_header 'Access-Control-Allow-Origin' '*'; + # add_header 'Access-Control-Allow-Credentials' 'true'; + # add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + # add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'; + # add_header 'Access-Control-Max-Age' 3600; + alias /storage; }