From a0fbbe11d311369a8f89b90d05ac29d6bc82282b Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 3 Sep 2022 16:38:14 +0200 Subject: [PATCH] hmm --- nginx/nginx.conf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 0fffcf7..32a5d00 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -61,13 +61,15 @@ http { return 204; } - add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev'; - add_header 'Access-Control-Allow-Credentials' 'true'; - add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS'; - add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization'; + if ($request_method != 'OPTIONS') { + add_header 'Access-Control-Allow-Origin' 'https://cors-school.nilstrieb.dev'; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, DELETE, PUT, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,token,refresh-token,Authorization'; - proxy_pass http://cors-school-backend:8080/; + proxy_pass http://cors-school-backend:8080/; + } } }