Skip to content

Commit

Permalink
🎉 version(architecture): v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Ting-Code committed Aug 20, 2024
1 parent b7c7343 commit aa4f31d
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ http {
expires -1; # 首页一般没有强制缓存
add_header Cache-Control no-cache;

add_header "Access-Control-Allow-Origin" $http_origin; # 全局变量获得当前请求origin,带cookie的请求不支持*
add_header "Access-Control-Allow-Origin" "*"; # 全局变量获得当前请求origin,带cookie的请求不支持*
add_header "Access-Control-Allow-Methods" "*"; # 允许请求方法
add_header "Access-Control-Allow-Headers" "*"; # 允许请求的 header
}
Expand All @@ -114,18 +114,10 @@ http {
expires -1; # 首页一般没有强制缓存
add_header Cache-Control no-cache;

add_header "Access-Control-Allow-Origin" $http_origin; # 全局变量获得当前请求origin,带cookie的请求不支持*
add_header "Access-Control-Allow-Origin" "*"; # 全局变量获得当前请求origin,带cookie的请求不支持*
add_header "Access-Control-Allow-Methods" "*"; # 允许请求方法
add_header "Access-Control-Allow-Headers" "*"; # 允许请求的 header
}
location ~*\.(js|css|png|jpg|jpeg|gif|ico)$ {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

root /usr/share/nginx/html/docs;
expires 30d;
}
}
}

0 comments on commit aa4f31d

Please sign in to comment.