# Load in the wx.sstbc.com server block before other matching regex locations. location = /storage/files/17939373196aed4fa7e9f94.pdf { return 404; } location ~* ^/storage/files/[^/]+\.pdf$ { try_files $uri =404; types {} default_type application/octet-stream; add_header Content-Disposition "attachment" always; add_header X-Content-Type-Options "nosniff" always; add_header Content-Security-Policy "sandbox" always; }