To download the file, you need add a block in nginx configuration of site:
server {
#...
location ~ ^/path/to/folder/.*\.mp4$ {
include /etc/nginx/include/download.conf;
}
#...
}
File /etc/nginx/include/download.conf contains the following code:
add_header Content-Disposition "attachment"; add_header Content-Type application/octet-stream;
An example of several extensions to downloa:
server {
#...
location ~ ^/path/to/folder/.*\.(mp4|mp3|avi|png)$ {
include /etc/nginx/include/download.conf;
}
#...
}
Then restart nginx:
service nginx reload
or
service nginx restart