Security headers set once at server level vanish on any location that adds a header of its own.
add_header X-Content-Type-Options nosniff always; # server block
location /downloads/ {
add_header Cache-Control "no-store" always; # parent header is dropped here
}
add_header is inherited from the level above only when the current level has no add_header of its own. In /downloads/ the X-Content-Type-Options header is therefore gone, so repeat it there or keep shared headers in a file and include it in each block. always adds the header to error responses too. Without it nginx only sends it on 200, 201, 204, 206, 301, 302, 303, 304, 307 and 308.
Further reading: ngx_http_headers_module: add_header
Going deeper: ๐ Guide: AdGuard Home + Tailscale (Secure Split-Horizon DNS)