X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/89344ae0c4f9114d07522330882b1b38da80d5c5..4ec4df296aa902456762ea9b95e6c6e4033e1076:/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 9202bf3e5..7c70e52ee 100644 --- a/cookbooks/tilecache/templates/default/nginx_tile.conf.erb +++ b/cookbooks/tilecache/templates/default/nginx_tile.conf.erb @@ -1,18 +1,18 @@ # DO NOT EDIT - This file is being maintained by Chef upstream tile_cache_backend { - server 127.0.0.1:8080 weight=1000; - server 127.0.0.2:8080 weight=1000; + server 127.0.0.1:8080 weight=1000 max_fails=32; + server 127.0.0.2:8080 weight=1000 max_fails=32; # Add the tile_siblings caches to relieve pressure if local squid failing # Balancer: round-robin <% server_weight = 1000 -%> -<% @node[:tilecache][:tile_siblings].each do |cache_peer| -%> +<% Array(@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 weight=<%= server_weight %> backup; # Server <%= cache[:hostname] %> + server <%= address %>:80 weight=<%= server_weight %> max_fails=32 backup; # Server <%= cache[:hostname] %> <% server_weight -= server_weight.div(2) -%> <% end -%> <% end -%>