Browse Source

no message

Gavin 6 years ago
parent
commit
42f2e8656c
2 changed files with 38 additions and 6 deletions
  1. 2 1
      k8swebapi-nginx/Dockerfile
  2. 36 5
      k8swebapi-nginx/conf.d/k8swebapi-nginx.conf

+ 2 - 1
k8swebapi-nginx/Dockerfile

@@ -14,4 +14,5 @@ RUN rm -rf /usr/share/nginx/html
 RUN mkdir /usr/share/nginx/html
 #COPY html /usr/share/nginx/html/
 
-EXPOSE 8006
+EXPOSE 8006
+EXPOSE 8100

+ 36 - 5
k8swebapi-nginx/conf.d/k8swebapi-nginx.conf

@@ -1,9 +1,40 @@
-upstream sharetransmit-svc {
-    server sharetransmit-svc:8006;
-}
+server {
+    listen 8006;
 
+    #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;
+
+    add_header Access-Control-Allow-Origin *;
+    add_header Access-Control-Allow-Headers X-Requested-With;
+    add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
+
+    charset utf-8;
+
+    server_name _;
+
+    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;
+
+        proxy_redirect off;
+        proxy_http_version 1.1;
+        proxy_pass http://sharetransmit-svc:8006;
+    }
+    
+    location /favicon.ico {
+        log_not_found off;
+        access_log off;
+    }
+}
 server {
-    listen 8050;
+    listen 8100;
 
     #ssl on;
     ssl_certificate ssl/xinyueyouxi.com.pem;
@@ -29,7 +60,7 @@ server {
 
         proxy_redirect off;
         proxy_http_version 1.1;
-        proxy_pass http://sharetransmit-svc;
+        proxy_pass http://sharetransmit-svc:8100;
     }
     
     location /favicon.ico {