diff --git a/.github/workflows/nginx.conf b/.github/workflows/nginx.conf index 3cca9e1..005fcd8 100644 --- a/.github/workflows/nginx.conf +++ b/.github/workflows/nginx.conf @@ -31,6 +31,13 @@ http { server_name 139.199.173.241; location / { + 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'; + + if ($request_method = 'OPTIONS') { + return 204; + } if ($request_filename ~* .*\.(?:htm|html)$) ## 配置页面不缓存html和htm结尾的文件 { add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";