matrix-docker-ansible-deploy icon indicating copy to clipboard operation
matrix-docker-ansible-deploy copied to clipboard

Unable to stream files from server

Open vjoomens opened this issue 5 years ago • 4 comments

Hi, I can't find any configuration to allow media streaming from the server. I get errors like "the server is not correctly configured" and does not allow byte range requests. Please help.

vjoomens avatar Nov 06 '19 10:11 vjoomens

So it turned out the fix was real easy. Just add the line below to the nginx proxy template, or add this line to a new file in the conf.d directory:

proxy_force_ranges on;

vjoomens avatar Nov 06 '19 10:11 vjoomens

Hi!

Seems like Synapse doesn't support media streaming. See: https://github.com/matrix-org/synapse/issues/4780

I guess proxy_force_ranges on is some workaround, which downloads the whole file at the reverse-proxy and slices it over there?

Given that media files are generally small-ish, it may not be much of a problem to force such a workaround. Still, we might prefer to do it for the /media endpoints only.

spantaleev avatar Nov 06 '19 10:11 spantaleev

@vjoomens, if you've got any more feedback on your experience with proxy_force_ranges, I'd be happy to hear it.

I'm a little wary about implementing it, especially for servers that have increased their media size limit. If we do implement it, it should probably be configurable, so people could disable it.

Imagine a 300MB media file, which nginx needs to cache (in memory?) for a long-long time, so that it can slice it and serve ranges.. Sounds like a good way to cause denial-of-service..

Of course, it may be that nginx acts smarter and it's not as dangerous.. I haven't tested it, nor could I find much information about how proxy_force_ranges works.

spantaleev avatar Nov 14 '19 08:11 spantaleev

Is there a way to achieve something similar to proxy_force_ranges on with Traefik?

greentore avatar May 08 '24 14:05 greentore