Skip to content

Commit

Permalink
Handle options separately
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Aug 1, 2024
1 parent 577fb1b commit b636373
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions sites-enabled/next.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ server {
}

location /api/v1/authenticate {
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' '*';
return 200;
}

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

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' '*';

proxy_set_header X-Real-IP $http_CF_Connecting_IP;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
Expand Down

0 comments on commit b636373

Please sign in to comment.