···9090 # decodes them via the narinfo's Compression field.
9191 # `resolve`: looked up at runtime via resolved's stub, so an unresolvable
9292 # B2 at startup doesn't keep nginx (and every other vhost) from starting.
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.
9396 services.nginx.appendHttpConfig = ''
9497 upstream cache_lassul_us_b2 {
9598 zone cache_lassul_us_b2 64k;
9699 resolver 127.0.0.53 ipv6=off;
97100 server ${endpoint}:443 resolve;
101101+ keepalive 64;
102102+ keepalive_requests 10000;
103103+ keepalive_timeout 60s;
98104 }
99105 map $uri $cache_lassul_us_encoding {
100106 default "";
···111117 proxy_set_header Host ${endpoint};
112118 proxy_ssl_server_name on;
113119 proxy_ssl_name ${endpoint};
120120+ proxy_http_version 1.1;
121121+ proxy_set_header Connection "";
114122 # cache keys never have a query string; don't forward one to S3
115123 set $args "";
116124 # S3 answers 403 for keys missing from a bucket it won't list