From e5280186bc116b76adfb0d4d31972ddfef7a9527 Mon Sep 17 00:00:00 2001 From: Max Goltzsche Date: Sat, 9 Dec 2023 00:52:42 +0100 Subject: [PATCH] docs: hide range-related headers from flask This is to prevent flask from returning a partial response for a range request when nginx is supposed to emulate range requests. Playing large opus files within firefox and gstreamer/mopidy worked for me only after I made this change in my nginx config. I guess this was not a problem previously since older flask versions did not support range queries at all but that seems to have changed partially since flask returns an `Accept-Ranges: bytes` header. Though, when using flask for streaming directly (without reverse-proxy), audio still doesn't play within firefox or gstreamer. gstreamer logged an error indicating the request is unsupported. --- README.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.rst b/README.rst index 9bf0685..c8f538c 100644 --- a/README.rst +++ b/README.rst @@ -65,6 +65,9 @@ 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-related headers from flask/backend server + proxy_hide_header "Accept-Ranges"; + proxy_set_header "Range" ""; } }