[download-web/mirrorbits] Set Expires header for regular files



commit 24808a356051ee64a4b5a9ff0aa7a02b9503c4c5
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Mon Jan 24 16:31:13 2022 +0100

    Set Expires header for regular files

 nginx/nginx.conf | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index c056f43..6336771 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -38,11 +38,6 @@ http {
             fancyindex_exact_size off;
         }
 
-        # location ~ .*/$ {
-        #     fancyindex on;
-        #     fancyindex_exact_size off;
-        # }
-
         location / {
             try_files $uri @index;
             proxy_set_header X-Forwarded-For $http_x_forwarded_for;
@@ -53,6 +48,11 @@ http {
         }
     }
 
+    map $sent_http_content_type $expires {
+        default   max;
+        text/html off;
+    }
+
     server {
         listen 8000;
         server_name download-fallback.gnome.org;
@@ -63,6 +63,8 @@ http {
             fancyindex on;
             fancyindex_exact_size on;
 
+            expires $expires;
+
             sendfile on;
             sendfile_max_chunk 5m;
             tcp_nopush on;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]