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