瀏覽代碼

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

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

+ 10 - 5
share-v2/sharesrv2-nginx/conf.d/sharesrv2-nginx.conf

@@ -10,21 +10,26 @@ server {
     ssl_prefer_server_ciphers on;
     ssl_session_timeout 5m;
 
-    add_header Access-Control-Allow-Origin *;
-    add_header Access-Control-Allow-Headers X-Requested-With;
-    add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
+   add_header 'Access-Control-Allow-Origin' '*';
+   add_header 'Access-Control-Allow-Credentials' 'true' ;
+   add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
+   add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,Accept,Origin,User-Agent,DNT,Cache-Control,X-Mx-ReqToken,Keep-Alive,X-Requested-With,Pragma,Cache-Control,If-Modified-Since';
 
     charset utf-8;
 
     server_name api-debug.xinyueyouxi.com;
 
-    location /share {
+    location / {
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header Remote_addr $remote_addr;
         proxy_set_header X-Real_IP $remote_addr;
         proxy_set_header Host $host;
+        if ($request_method = 'OPTIONS') {
+           return 200;
+        }
+
         
-        proxy_pass http://172.21.164.128:9092;
+        proxy_pass http://sharesrv2-svc:9092;
     }
     
     location /favicon.ico {