isv-robot 2 år sedan
förälder
incheckning
8b5affa435
3 ändrade filer med 28 tillägg och 4 borttagningar
  1. 2 2
      .drone.yml
  2. 1 1
      Dockerfile
  3. 25 1
      nginx-conf/conf.d/default.conf

+ 2 - 2
.drone.yml

@@ -51,8 +51,8 @@ steps:
       debug: true
       script:
         - cd /www/wwwroot/railway-web.iamsee.com/release
-        - docker build -t iamsee/gdsc-web:1.0.0 .
-        - docker save -o gdsc-web@1.0.0.tar iamsee/gdsc-web:1.0.0
+        - docker build -t iamsee/railway-web:1.0.0 .
+        - docker save -o railway-web@1.0.0.tar iamsee/railway-web:1.0.0
 volumes:
   - name: cache # The name use in this pipeline,
     host:

+ 1 - 1
Dockerfile

@@ -4,7 +4,7 @@ FROM nginx:1.21.6-alpine
 MAINTAINER iamsee "root@iamsee.com"
 
 # The environment variable
-ENV APP_NAME="gdsc-web"
+ENV APP_NAME="railway-web"
 
 COPY nginx-conf /etc/nginx/
 

+ 25 - 1
nginx-conf/conf.d/default.conf

@@ -14,6 +14,31 @@ server {
         autoindex_exact_size off;   #文件大小从KB开始显示
         autoindex_localtime on;   #显示文件修改时间为服务器本地时间
     }
+
+    location /api {
+        proxy_pass http://railwayAdmin:2021;
+        proxy_read_timeout 300s;
+        proxy_set_header Host railway.iamsee.com;
+        proxy_set_header X-Real-IP $remote_addr;
+        # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+        proxy_set_header x-forwarded-for $remote_addr;
+        proxy_set_header REMOTE-HOST $remote_addr;
+
+        add_header X-Cache $upstream_cache_status;
+
+        #Set Nginx Cache
+
+        	add_header Cache-Control no-cache;
+
+       	if ( $uri ~* "/profile.*/(.*)" ){
+        	add_header Access-Control-Expose-Headers "Content-Disposition";
+
+            add_header Content-Disposition "attachment;filename=$1";
+        }
+
+
+    }
+
     location ~ /.well-known {
         allow all;
         autoindex on;
@@ -25,4 +50,3 @@ server {
     #    deny  all;
     #}
 }
-