In my server block I have
location / {
proxy_pass http://echocdn;
include /etc/nginx/mime.types;
add_header Cache-Control "max-age=31536000, private, no-transform, no-cache";
location ~* \.apk$ {
add_header Content-Type application/vnd.android.package-archive;
add_header Content-Disposition "attachment";
}
}
If I remove the inner location block, I can reach the APK file (and all other files).
With the block added, any .apk file returns a 404. How do I add the headers for APK files?
Note: Content types for other file types are handled well by the included mime.types, but even if I add the line for APK files as described How to download ".apk" as ".apk"? (not as ".zip") and https://blog.mypapit.net/2015/08/how-to-set-apk-mime-type-for-nginx-web-server.html it only returns a content-type of text/html for apk files.