]> git.openstreetmap.org Git - chef.git/commitdiff
imagery: improve tiler caching and keepalive
authorGrant Slater <github@firefishy.com>
Tue, 26 Mar 2024 20:56:17 +0000 (20:56 +0000)
committerGrant Slater <github@firefishy.com>
Tue, 26 Mar 2024 20:56:17 +0000 (20:56 +0000)
cookbooks/imagery/templates/default/nginx_titiler.conf.erb

index cebf0efab311403712dd5de4db035c7355a452ec..e849484418b5606dc8827d7296063410e9298ed7 100644 (file)
@@ -63,6 +63,7 @@ server {
       proxy_set_header X-Forwarded-Proto https;
       proxy_set_header X-Forwarded-SSL on;
       proxy_http_version 1.1;
+      proxy_set_header "Connection" "";
       proxy_redirect off;
     }
 
@@ -76,10 +77,16 @@ server {
       proxy_set_header X-Forwarded-Proto https;
       proxy_set_header X-Forwarded-SSL on;
       proxy_http_version 1.1;
+      proxy_set_header "Connection" "";
       proxy_redirect off;
       proxy_cache_key "$scheme$proxy_host$uri";
       proxy_cache ngi-aerial;
-      proxy_cache_valid any 90d;
+      proxy_cache_valid 200 204 180d;
+      proxy_cache_use_stale error timeout updating http_502 http_503 http_504;
+      proxy_cache_background_update on;
+      proxy_ignore_headers Cache-Control;
       expires max;
+      add_header X-Proxy-Cache $upstream_cache_status;
+
     }
 }