From d6156e0900cc62cfc74393b647e14a4def22119d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 15 Dec 2023 23:04:10 +0100 Subject: [PATCH] Update nginx.conf --- conf/nginx.conf | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d56d97a..57e2c51 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -12,7 +12,7 @@ location __PATH__/ { # # Custom headers and headers various browsers *should* be OK with but aren't # - 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-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range"; # # Tell client that this pre-flight info is valid for 20 days # @@ -21,7 +21,14 @@ location __PATH__/ { more_set_headers "Content-Length: 0"; return 204; } - if ($request_method = (POST|GET)$) { + if ($request_method = 'POST') { + more_set_headers "Access-Control-Allow-Origin: * always"; + more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS always"; + more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always"; + more_set_headers "Access-Control-Expose-Headers: Content-Length,Content-Range always"; + } + + if ($request_method = 'GET') { more_set_headers "Access-Control-Allow-Origin: * always"; more_set_headers "Access-Control-Allow-Methods: GET, POST, OPTIONS always"; more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range always";