tilecache: only use cache peers as fallback upstream
authorGrant Slater <git@firefishy.com>
Mon, 27 May 2019 23:43:36 +0000 (00:43 +0100)
committerGrant Slater <git@firefishy.com>
Mon, 27 May 2019 23:44:04 +0000 (00:44 +0100)
cookbooks/tilecache/templates/default/nginx_tile.conf.erb

index 4c99dfb0eb7f85246d73cdfe77e9359386277ed1..b6873f39a24b08d8b5632a75daefd74476a9c60d 100644 (file)
@@ -7,10 +7,12 @@ upstream tile_cache_backend {
   # Balancer: round-robin
 <% @caches.each do |cache| -%>
 <% if cache[:hostname] != node[:hostname] -%>
+<% if node[:tilecache][:tile_siblings].include? cache[:hostname] -%>
 <% cache.ipaddresses(:family => :inet, :role => :external).sort.each do |address| -%>
   server <%= address %> backup; # Server <%= cache[:hostname] %>
 <% end -%>
 <% end -%>
+<% end -%>
 <% end -%>
 
   keepalive 256;
@@ -96,7 +98,7 @@ server {
       proxy_http_version 1.1;
       proxy_set_header Connection '';
 
-      proxy_connect_timeout 10s;
+      proxy_connect_timeout 5s;
 
       # Preserve host header.
       proxy_set_header Host $host;