From 05b8b32a2a7a09b8caf5b6356aa446c90b0e4986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Wypch=C5=82o?= Date: Tue, 18 Aug 2020 14:42:17 +0200 Subject: [PATCH] Fix cors issues (#345) * enable cord * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors * enable cors --- docker/nginx/conf.d/cors.conf | 4 ---- docker/nginx/conf.d/include/cors | 17 +++++++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) delete mode 100644 docker/nginx/conf.d/cors.conf diff --git a/docker/nginx/conf.d/cors.conf b/docker/nginx/conf.d/cors.conf deleted file mode 100644 index 6c8cff35..00000000 --- a/docker/nginx/conf.d/cors.conf +++ /dev/null @@ -1,4 +0,0 @@ -more_set_headers 'Access-Control-Allow-Origin: *'; -more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'; -more_set_headers 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; -more_set_headers 'Access-Control-Expose-Headers: Content-Length,Content-Range'; diff --git a/docker/nginx/conf.d/include/cors b/docker/nginx/conf.d/include/cors index 1490624b..818ac28d 100644 --- a/docker/nginx/conf.d/include/cors +++ b/docker/nginx/conf.d/include/cors @@ -1,9 +1,14 @@ if ($request_method = 'OPTIONS') { - add_header 'Access-Control-Allow-Origin' '*'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; - add_header 'Access-Control-Max-Age' 1728000; # valid for 20 days - add_header 'Content-Type' 'text/plain; charset=utf-8'; - add_header 'Content-Length' 0; + more_set_headers 'Access-Control-Allow-Origin: *'; + more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'; + more_set_headers 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; + more_set_headers 'Access-Control-Max-Age: 1728000'; + more_set_headers 'Content-Type: text/plain; charset=utf-8'; + more_set_headers 'Content-Length: 0'; return 204; } + +more_set_headers 'Access-Control-Allow-Origin: *'; +more_set_headers 'Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE'; +more_set_headers 'Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range'; +more_set_headers 'Access-Control-Expose-Headers: Content-Length,Content-Range,Skynet-File-Metadata';