From 48153899921a1e5958936fa32730df6731e97c6b Mon Sep 17 00:00:00 2001 From: Joakim Olsson Date: Thu, 29 Apr 2021 17:53:30 +0200 Subject: [PATCH] fix: add CORS headers to PUT-responses as well --- nginx.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/nginx.conf b/nginx.conf index ae5f810..322b94a 100644 --- a/nginx.conf +++ b/nginx.conf @@ -91,6 +91,11 @@ http { resolver 8.8.8.8 valid=300s; resolver_timeout 10s; add_header 'Access-Control-Expose-Headers' 'X-File-Url'; + add_header 'Access-Control-Allow-Origin' "*" ; + add_header 'Access-Control-Allow-Credentials' 'true' ; + add_header 'Access-Control-Allow-Methods' 'GET, PUT, OPTIONS' ; + add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With'; + add_header 'Access-Control-Max-Age' 1728000; proxy_pass $url; } @@ -153,6 +158,11 @@ http { resolver 8.8.8.8 valid=300s; resolver_timeout 10s; add_header 'Access-Control-Expose-Headers' 'X-File-Url'; + add_header 'Access-Control-Allow-Origin' "*" ; + add_header 'Access-Control-Allow-Credentials' 'true' ; + add_header 'Access-Control-Allow-Methods' 'GET, PUT, OPTIONS' ; + add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With'; + add_header 'Access-Control-Max-Age' 1728000; proxy_pass $url; }