Score:0

How to setup content range in NGINX?

in flag

I use django framework and I try to setup NGINX that server play video in browser chunk by chunk.

nginx.conf

proxy_cache_path /tmp/mycache keys_zone=mycache:100m;
server {
            listen 80;
            server_name localhost;

                proxy_cache mycache;
                slice              1m;
                proxy_cache_key    $host$uri$is_args$args$slice_range;
                proxy_set_header   Range $slice_range;
                proxy_http_version 1.1;
                proxy_cache_valid  200 206 1h;


            location / {
                include proxy_params;
                proxy_pass http://unix:/run/gunicorn.sock;
                       }


            location /vid/ {
                alias /home/affil/videos/;
               }
}

When I try locally

127.0.0.1/vid/test.mp4

, the video starts in browser as partial (206). Fast load.

When I try

http://[my_server_external_ip]/vid/test.mp4

, content range disappear and video starts playing after long time preload.

What's wrong with settings?

Klamber avatar
ru flag
Perhaps this article has any help: https://www.nginx.com/blog/smart-efficient-byte-range-caching-nginx/
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.