Sfoglia il codice sorgente

更新 'k8swebapi-nginx/conf.d/k8swebapi-nginx.conf'

chenghongxi 4 anni fa
parent
commit
4cce59aa3c
1 ha cambiato i file con 14 aggiunte e 18 eliminazioni
  1. 14 18
      k8swebapi-nginx/conf.d/k8swebapi-nginx.conf

+ 14 - 18
k8swebapi-nginx/conf.d/k8swebapi-nginx.conf

@@ -110,31 +110,27 @@ server {
 }
 server {
     listen 80;
-
-    #ssl on;
-    ssl_certificate ssl/xinyueyouxi.com.pem;
-    ssl_certificate_key ssl/xinyueyouxi.com.key;
-    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
-    ssl_ciphers HIGH:!RC4:!MD5:!aNULL:!eNULL:!NULL:!DH:!EDH:!EXP:+MEDIUM;
-    ssl_prefer_server_ciphers on;
-    ssl_session_timeout 5m;
+    server_name web-test.278740.cn;
+    charset utf-8;
 
     add_header Access-Control-Allow-Origin *;
-    add_header Access-Control-Allow-Headers X-Requested-With;
+    add_header Access-Control-Allow-Headers *;
     add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
+    if ($request_method = 'OPTIONS') {
+        return 204;
+    }
+    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;
+    proxy_set_header X-CROS true;  # 自定义,有做跨域的时候需要加,后端会做判断
+    proxy_redirect off;
+    proxy_http_version 1.1;
 
-    charset utf-8;
-
-    server_name web-test.278740.cn;
 
     location / {
         root /usr/share/nginx/html/businessweb;
         try_files $uri $uri/ /index.html;
-        #index index.html;
-    }
-    
-    location /favicon.ico {
-        log_not_found off;
-        access_log off;
+        index index.html;
     }
 }