瀏覽代碼

更新 'share-v2/sharesrv2-nginx/conf.d/sharesrv2-nginx.conf'

chenghongxi 4 年之前
父節點
當前提交
83849f1b2c
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      share-v2/sharesrv2-nginx/conf.d/sharesrv2-nginx.conf

+ 4 - 3
share-v2/sharesrv2-nginx/conf.d/sharesrv2-nginx.conf

@@ -13,9 +13,7 @@ server {
     add_header 'Access-Control-Allow-Origin' '*';
     add_header 'Access-Control-Allow-Credentials' 'true' ;
     add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
-    if ($request_method = 'OPTIONS') {
-        return 204;
-    }
+    
     charset utf-8;
 
     server_name api-debug.xinyueyouxi.com;
@@ -28,6 +26,9 @@ server {
     proxy_set_header X-CROS true;  # 自定义,有做跨域的时候需要加,后端会做判断
     proxy_redirect off;
     proxy_http_version 1.1;
+    if ($request_method = 'OPTIONS') {
+        return 204;
+    }
     proxy_pass http://sharesrv2-svc:9092;
     }