فهرست منبع

chore: 修改nginx配置

TianChenjiang 4 سال پیش
والد
کامیت
b2a41fd40b
2فایلهای تغییر یافته به همراه29 افزوده شده و 3 حذف شده
  1. 3 3
      Dockerfile
  2. 26 0
      nginx.conf

+ 3 - 3
Dockerfile

@@ -5,6 +5,6 @@ COPY . .
 RUN npm i && npm run generate
 
 
-FROM nginx:latest
-#COPY nginx.conf /etc/nginx/
-COPY --from=base dist /var/www/p.seec.seecoder.cn/public/
+FROM nginx:1.19-alpine
+COPY nginx.conf /etc/nginx/conf.d/nginx.conf
+COPY --from=base dist /var/www/html/dist/

+ 26 - 0
nginx.conf

@@ -0,0 +1,26 @@
+map $http_upgrade $connection_upgrade {
+  default upgrade;
+  '' close;
+}
+
+server {
+        listen 80 default_server;
+        listen [::]:80 default_server;
+        root /var/www/html/dist;
+
+        # reverse proxy
+        location /interaction {
+            proxy_pass                         http://environment-24-71.seec.svc.cluster.local:8080;
+        }
+
+        location ~ /api {
+      	    proxy_pass http://environment-24-71.seec.svc.cluster.local:8080;
+      	    proxy_set_header Host             $host;
+      	    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+      	    proxy_set_header X-Forwarded-Proto $scheme;
+      	    proxy_set_header X-Forwarded-Port $server_port;
+  	}
+        location ~ / {
+            try_files $uri $uri/ /index.html;
+        }
+}