Skip to content

Commit

Permalink
docs: hide range-related headers from flask
Browse files Browse the repository at this point in the history
This is to prevent flask from handling range requests when nginx is emulates range responses.
Playing large opus files within firefox and gstreamer/mopidy worked for me only after I made this change in my nginx config.
When using flask for streaming directly (without reverse-proxy), audio still doesn't play within firefox or gstreamer - prior to beets 1.6.1.
  • Loading branch information
mgoltzsche committed Dec 26, 2023
1 parent eeb3b4f commit e1ea321
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ Configuration
Proxy configuration for OGG files (optional)
--------------------------------------------

You may want to configure an http proxy server in front of your Beets plugin
(not mopidy). Otherwise you could have problems with playing OGG files and
other formats that require seeking (in technical terms: support for http
"Range" requests is required for these files).
In case you use a beets version older than 1.6.1, you may need to configure
an HTTP reverse-proxy server in front of the Beets web plugin (not mopidy)
because [it does not handle HTTP "Range" requests properly](https://github.com/beetbox/beets/pull/5057).
If you don't apply this workaround, mopidy may not be able to stream/play
large audio files and/or does not allow you to seek.
The is the case for OGG files in particular.

The following Nginx configuration snippet is sufficient::

Expand All @@ -65,6 +67,8 @@ The following Nginx configuration snippet is sufficient::
proxy_pass http://localhost:8337;
# this statement forces Nginx to emulate "Range" responses
proxy_force_ranges on;
# Hide Range header from beets/flask, preventing range handling
proxy_set_header "Range" "";
}
}

Expand Down

0 comments on commit e1ea321

Please sign in to comment.