Web Analytics
How can I Auto download Mp3 on nginx server - StoreFront Forums

How can I Auto download Mp3 on nginx server

Streetot

Active member
Contributor
Sep 6, 2021
142
46
28
streetott.com.ng
My Mp3 files is playing instead of downloading and I have use this code

#forcemp3
<FilesMatch "\.(zip|mp3|mp4|wav|pdf)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</FilesMatch> But not working
 
Solution
Nginx doesn't support .htaccess. The code you provided requires .htaccess.

What you should do is to convert the .htaccess code and add it to nginx.conf, commonly found at /etc/nginx/nginx.conf or /etc/nginx/sites-available/default or a similar location depending on your server setup).

Example

NGINX:
location ~* \.(zip|mp3|mp4|wav|pdf)$ {
    add_header Content-Disposition "attachment";
    default_type application/octet-stream;
}

Pedro

Forum Admin
Staff member
Trusted Uploader
Contributor
Aug 21, 2021
1,480
3
2,380
113
Genesis Forum
storefront.com.ng
Nginx doesn't support .htaccess. The code you provided requires .htaccess.

What you should do is to convert the .htaccess code and add it to nginx.conf, commonly found at /etc/nginx/nginx.conf or /etc/nginx/sites-available/default or a similar location depending on your server setup).

Example

NGINX:
location ~* \.(zip|mp3|mp4|wav|pdf)$ {
    add_header Content-Disposition "attachment";
    default_type application/octet-stream;
}
 
Last edited:
Solution

New Posts

Forum statistics

Threads
877
Messages
5,458
Members
2,940
Latest member
huIGIghoHoihO
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock    No Thanks