H
H
Homer_Simpson2014-03-20 16:46:31
PHP
Homer_Simpson, 2014-03-20 16:46:31

How to arrange video download using nginx?

Can I have a simple config or a link for setting up video output using nginx?
There is a server, in the folder there is a video in mp4, it is necessary that when the user enters site.com/video/1.mp4, the video download starts (that is, a window pops up asking you to save the file).
In Google, all the tips on live streaming.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rpsl, 2014-03-20
@Homer_Simpson

So that the file does not play in the browser, but a window appears with a suggestion to download the file, you need to register the title.
More or less like this:

location ~* /video/(.*)$ {
    add_header Content-disposition "attachment; filename=$1";
    root /var/www/site.com/video;
}

D
Dron Krzh, 2014-03-20
@ walkman7

https://gist.github.com/un33k/7119264

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question