Skip to content

Commit

Permalink
Fix CORS headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Volendi committed Jan 14, 2021
1 parent 2e716d7 commit ccbcb22
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions configs/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ http {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, OPTIONS, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature,Account-Id' always;
add_header 'Access-Control-Allow-Credentials' true always;
add_header 'Access-Control-Max-Age' 1728000 always;
add_header 'Content-Type' 'text/plain; charset=utf-8' always;
Expand All @@ -35,39 +35,39 @@ http {
if ($request_method = 'DELETE') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, OPTIONS, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature,Account-Id' always;
add_header 'Access-Control-Allow-Credentials' true always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}

if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, OPTIONS, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature,Account-Id' always;
add_header 'Access-Control-Allow-Credentials' true always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}

if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, OPTIONS, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature,Account-Id' always;
add_header 'Access-Control-Allow-Credentials' true always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}

if ($request_method = 'PATCH') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, OPTIONS, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature,Account-Id' always;
add_header 'Access-Control-Allow-Credentials' true always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}

if ($request_method = 'PUT') {
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, OPTIONS, DELETE' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature' always;
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Signature,Account-Id' always;
add_header 'Access-Control-Allow-Credentials' true always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
}
Expand Down

0 comments on commit ccbcb22

Please sign in to comment.