Revert "修复语法问题"

This reverts commit de27a23b4f.
This commit is contained in:
2026-02-12 16:38:52 +08:00
parent de27a23b4f
commit 400c7013ac
2 changed files with 16 additions and 13 deletions

View File

@@ -2,6 +2,17 @@ server {
listen 9000;
server_name _;
# CORS
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
# pre-flight requests
if ($request_method = 'OPTIONS') {
return 204;
}
index index.php;
root /var/www/html;
@@ -18,13 +29,5 @@ server {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always;
add_header 'Access-Control-Allow-Credentials' 'true' always;
return 204;
}
}
}