From d315fa4ad29809afed70719beada3a8d71185c58 Mon Sep 17 00:00:00 2001 From: wanglei <34475144@qqcom> Date: Mon, 10 Nov 2025 09:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E5=89=8D=E7=AB=AF=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=97=B6=E8=B7=A8=E5=9F=9F=E9=97=AE=E9=A2=98=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=85=81=E8=AE=B8=E8=B7=A8=E5=9F=9F?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/nginx.conf | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index efdf26a..9864f7f 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -52,6 +52,16 @@ http { ## 应用路径 todo 路径问题 set $APP_PATH '/home/frankly/work/AuthPlatform'; + #访问时允许跨域处理 + access_by_lua_block { + ngx.header["Access-Control-Allow-Origin"] = "*" + ngx.header["Access-Control-Allow-Methods"] = "GET, POST, DELETE, PUT" + ngx.header["Access-Control-Allow-Headers"] = "Content-Type, Authorization" + if ngx.var.request_method == "OPTIONS" then + ngx.exit(ngx.HTTP_NOT_ALLOWED) + end + } + #数据列表配置 include 'system/system.conf'; @@ -81,10 +91,10 @@ http { } } - server { - listen 9081 ssl http2; - server_name *.*; - ssl_certificate ssl/metroid.crt; - ssl_certificate_key ssl/metroid.key; - } + #server { + # listen 9081 ssl http2; + # server_name *.*; + # ssl_certificate ssl/metroid.crt; + # ssl_certificate_key ssl/metroid.key; + #} } \ No newline at end of file