From 75925b6cebdbcfc3797ca75ed93d782a3d635a74 Mon Sep 17 00:00:00 2001 From: ansuz Date: Sat, 4 Jan 2020 01:39:31 -0500 Subject: [PATCH] fix blob support in example config --- docs/example.nginx.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/example.nginx.conf b/docs/example.nginx.conf index b9bb71d4a..c382910b9 100644 --- a/docs/example.nginx.conf +++ b/docs/example.nginx.conf @@ -154,7 +154,23 @@ server { # encrypted blobs are immutable and are thus cached for a year location ^~ /blob/ { + 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,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Conten +t-Type,Content-Range,Range'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'application/octet-stream; charset=utf-8'; + add_header 'Content-Length' 0; + return 204; + } add_header Cache-Control max-age=31536000; + add_header 'Access-Control-Allow-Origin' '*'; + 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-Ty +pe,Content-Range,Range'; + add_header 'Access-Control-Expose-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-T +ype,Content-Range,Range'; try_files $uri =404; }