X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/751317da2082df39c5fa65f432aa70d68bd8c1ac..0c82d0842e77184f2080f0d2bae5ab343c55ca54:/cookbooks/tilecache/templates/default/nginx_tile.conf.erb diff --git a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb index a6adb0e5b..4495f568a 100644 --- a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb +++ b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb @@ -4,18 +4,23 @@ upstream tile_cache_backend { server 127.0.0.1:8080; server 127.0.0.2:8080; - # Add the other caches to relieve pressure if local squid failing + # Add the tile_siblings caches to relieve pressure if local squid failing # Balancer: round-robin +<% server_weight = 20 -%> +<% @node[:tilecache][:tile_siblings].each do |cache_peer| -%> <% @caches.each do |cache| -%> +<% if cache_peer == cache[:fqdn] -%> <% if cache[:hostname] != node[:hostname] -%> <% cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address| -%> - server <%= address %>:80 backup; # Server <%= cache[:hostname] %> + server <%= address %>:80 weight=<%= server_weight.div(10) %>; # Server <%= cache[:hostname] %> +<% server_weight += 5 -%> +<% end -%> +<% end -%> <% end -%> <% end -%> <% end -%> - keepalive 512; - keepalive_requests 1024; + keepalive 128; } # Geo Map of tile caches @@ -71,6 +76,13 @@ map $http_user_agent $denied_scraper { 'com.soft373.taptaxi' 1; 'com.kradac.ktxcore' 1; 'ru.crowdsystems.topcontrol.knd' 1; + 'pl.itaxi.driver' 1; + 'net.uztaxi.driver' 1; + 'OSMDroid/2.1 (its; rutaxi 3.28.0)' 1; + 'com.helleniccomms.mercedes.driver' 1; + 'ru.taximaster.www' 1; + 'com.arobs.trackgps' 1; + 'com.helleniccomms.asteras.driver' 1; # '~[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}' 1; # Fake UA }