]> git.openstreetmap.org Git - chef.git/commitdiff
tilecache: remove cache poisoning headers
authorGrant Slater <git@firefishy.com>
Fri, 22 Nov 2019 14:37:15 +0000 (14:37 +0000)
committerGrant Slater <git@firefishy.com>
Fri, 22 Nov 2019 14:37:15 +0000 (14:37 +0000)
cookbooks/tilecache/templates/default/nginx_tile.conf.erb

index d461b0640ee59702ede0af3e4403f783ce7d596c..f53cb4ec440e9762d0a37bcd7e62f08a16e708f8 100644 (file)
@@ -179,14 +179,28 @@ server {
       proxy_http_version 1.1;
       proxy_set_header Connection '';
 
-      proxy_connect_timeout 5s;
+      proxy_connect_timeout 10s;
 
-      # Preserve host header.
-      proxy_set_header Host $host;
+      # Replace host header.
+      proxy_set_header Host 'tile.openstreetmap.org';
       # Do not pass cookies to backends.
       proxy_set_header Cookie '';
       # Do not pass Accept-Encoding to backends.
       proxy_set_header Accept-Encoding '';
+      # Do not pass Accept to backends.
+      proxy_set_header Accept '';
+      # Do not pass Accept-Language to backends as unused.
+      proxy_set_header Accept-Language '';
+      proxy_set_header Accept-Charset '';
+      # Do not send origin, we allow all.
+      proxy_set_header origin '';
+      # Do not pass invalid header to backend.
+      proxy_set_header X-Forwarded-Host '';
+      proxy_set_header X-Host '';
+      proxy_set_header Authorization '';
+
+      # Drop partial requests
+      proxy_set_header range '';
 
       # Do not allow setting cookies from backends due to caching.
       proxy_ignore_headers Set-Cookie;