Skip to content

Commit

Permalink
Maybe fix cors
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Aug 8, 2024
1 parent d4027c4 commit e20c522
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions sites-enabled/next.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ server {
}

location ~ /api/v1/(authenticate|users/(\d+)) {
add_header 'Access-Control-Allow-Origin' $cors_allowed_origin always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'origin, content-type, accept' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;

if ($request_method = OPTIONS) {
add_header 'Access-Control-Allow-Origin' $cors_allowed_origin always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'origin, content-type, accept';
add_header 'Access-Control-Allow-Credentials' 'true';
return 200;
}
add_header 'Access-Control-Allow-Origin' $cors_allowed_origin always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'origin, content-type, accept';
add_header 'Access-Control-Allow-Credentials' 'true';

limit_req zone=users_zone burst=10 nodelay;
limit_req_status 429;
Expand Down

0 comments on commit e20c522

Please sign in to comment.