Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed Jul 23, 2024
1 parent 591b2c5 commit f364641
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 6 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ http {
access_log /var/log/nginx/access.log main if=$loggable;
error_log /var/log/nginx/error.log;

map $http_origin $cors_allowed_origin {
default "";
"https://akatsuki.gg" "https://akatsuki.gg";
"https://next.akatsuki.gg" "https://next.akatsuki.gg";
}

# connection header for WebSocket reverse proxy
map $http_upgrade $connection_upgrade {
default upgrade;
Expand Down
10 changes: 2 additions & 8 deletions sites-enabled/frontend.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,8 @@ server {
limit_req zone=api_zone burst=10 nodelay;
limit_req_status 429;

map "$http_origin" $cors {
default "";
"https://akatsuki.gg" "https://akatsuki.gg";
"https://next.akatsuki.gg" "https://next.akatsuki.gg";
}

add_header 'Access-Control-Allow-Origin' "$cors" always;
add_header 'Access-Control-Allow-Methods' 'POST, GET, 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' '*';
add_header 'Access-Control-Max-Age' '21600';

Expand Down

0 comments on commit f364641

Please sign in to comment.