]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tilecache/templates/default/nginx_tile.conf.erb
tilecache: only rate limit clients not peers
[chef.git] / cookbooks / tilecache / templates / default / nginx_tile.conf.erb
index 4495f568af839ef6457874b05b9ab61371ac973c..8202ad9804aa5574d2f6d8b80489b1067e6da97a 100644 (file)
@@ -25,10 +25,10 @@ upstream tile_cache_backend {
 
 # Geo Map of tile caches
 geo $tile_cache {
-  default 0;
+  default "client";
 <% @caches.each do |cache| -%>
 <% cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address| -%>
-  <%= address %> 1; # <%= cache[:hostname] %>
+  <%= address %> "cache"; # <%= cache[:hostname] %>
 <% end -%>
 <% end -%>
 }
@@ -142,13 +142,13 @@ map $osm_referer$http_user_agent $limit_http_pragma {
 
 # Find Browser User-Agents which are not sending a referer.
 # Browsers with no referer could be due to Browser extension or website Referrer-Policy
-map $http_referer$scheme$http_user_agent $deny_missing_referer {
+map $tile_cache$http_referer$scheme$http_user_agent $deny_missing_referer {
   default                             0; # Not denied
-  '~^httpsMozilla\/5\.0\ \(X11'       1;
-  '~^httpsMozilla\/5\.0\ \(Windows'   1;
-  '~^httpsMozilla\/5\.0\ \(iPhone'    1;
-  '~^httpsMozilla\/5\.0\ \(Macintosh' 1;
-  '~^httpsMozilla\/5\.0\ \(Linux'     1;
+  '~^clienthttpsMozilla\/5\.0\ \(X11'       1;
+  '~^clienthttpsMozilla\/5\.0\ \(Windows'   1;
+  '~^clienthttpsMozilla\/5\.0\ \(iPhone'    1;
+  '~^clienthttpsMozilla\/5\.0\ \(Macintosh' 1;
+  '~^clienthttpsMozilla\/5\.0\ \(Linux'     1;
 }
 
 server {