From f344ecc5c7f332dde8fccbfcc31f5a4b12f01557 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Tue, 28 May 2019 00:43:36 +0100 Subject: [PATCH 1/1] tilecache: only use cache peers as fallback upstream --- cookbooks/tilecache/templates/default/nginx_tile.conf.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb index 4c99dfb0e..b6873f39a 100644 --- a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb +++ b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb @@ -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; -- 2.43.2