heavyrain 12 hours ago
parent
commit
e956706c38
1 changed files with 10 additions and 3 deletions
  1. 10 3
      nginx/nginx.conf

+ 10 - 3
nginx/nginx.conf

@@ -10,15 +10,22 @@ server {
     }
 
     location ^~ /api {
-        proxy_pass http://backend:8082;
+        proxy_pass http://backend:8082/;
         proxy_set_header Host $host;
         proxy_set_header X-Real-IP $remote_addr;
         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
         proxy_set_header X-Forwarded-Proto $scheme;
         proxy_set_header REMOTE-HOST $remote_addr;
         proxy_http_version 1.1;
-
         add_header X-Cache $upstream_cache_status;
-
+        set $static_fileTU7903MC 0;
+        if ($uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$") {
+            set $static_fileTU7903MC 1;
+            expires 1m;
+        }
+        if ($static_fileTU7903MC = 0) {
+            add_header Cache-Control no-cache;
+        }
     }
+
 }