From: Grant Slater Date: Sun, 5 Apr 2020 20:40:00 +0000 (+0100) Subject: tilecache: only rate limit clients not peers X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/e790bebda87fffe3a6b3f6d29031b257ad5cbd6e tilecache: only rate limit clients not peers --- diff --git a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb index 4495f568a..8202ad980 100644 --- a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb +++ b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb @@ -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 {