diff --git a/imports/nginx.conf b/imports/nginx.conf index 012e738..abdc0cd 100644 --- a/imports/nginx.conf +++ b/imports/nginx.conf @@ -37,8 +37,21 @@ server { location /mock-donor-service/ { proxy_pass http://mock-donor-service:5001/; # CORS headers - add_header 'Access-Control-Allow-Origin' '*'; - } + 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' 'Authorization, Content-Type'; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + } + add_header 'Access-Control-Allow-Origin' '*'; + add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'; + add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type'; + add_header 'Access-Control-Allow-Credentials' 'true'; + } error_page 500 502 503 504 /50x.html;