Skip to content

Commit

Permalink
Merge pull request #418 from Sreejit-K/demo-donor
Browse files Browse the repository at this point in the history
Added header for preflight requests
  • Loading branch information
srprasanna authored Mar 5, 2024
2 parents 611fdc3 + 2add73b commit 0cccf49
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions imports/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0cccf49

Please sign in to comment.