···9393 # `keepalive` + HTTP/1.1 below: reuse TLS connections to B2. Without them
9494 # nginx spoke HTTP/1.0 with a new handshake per request; at a farm run's
9595 # ~400 req/s B2 started closing connections mid-response.
9696+ # `max_fails=0`: B2 closes idle keepalive connections now and then. With the
9797+ # default max_fails=1 one such close marked that B2 address down for 10s;
9898+ # once all of them were, every request got "no live upstreams" and a 502
9999+ # (failed a farm run). A GET/HEAD on a closed reused connection is retried
100100+ # (default `proxy_next_upstream error timeout`) without using up a try, on
101101+ # the next address, or on the same one if it resolves to only one.
96102 services.nginx.appendHttpConfig = ''
97103 upstream cache_lassul_us_b2 {
98104 zone cache_lassul_us_b2 64k;
99105 resolver 127.0.0.53 ipv6=off;
100100- server ${endpoint}:443 resolve;
106106+ server ${endpoint}:443 resolve max_fails=0;
101107 keepalive 64;
102108 keepalive_requests 10000;
103109 keepalive_timeout 60s;