Nginx Download MP3 206 Partial Content HTTP Response nginx-forum at
Mon Nov 9 09:45:31 UTC 2020


That was it!  The subsequent, asynchronous AJAX call was responding with a
Javascript redirect that was remedied using Nginx's sub_filter directive.

        location / {
            proxy_bind $server_addr;
            proxy_pass https://$host$request_uri;
            proxy_redirect https:// http://;
            proxy_set_header Accept-Encoding ""; # Needed by sub_filter to
disable gzip compression
            sub_filter_types text/javascript text/css text/xml;
            sub_filter 'https:' 'http:';
            sub_filter_once off;

The combination of disabling gzip compression, adding sub_filter_types
text/javascript, and creating sub_filter 'https:' 'http:' rewrote the
protocol of the Javascript redirect.


Then, I was able to download MP3's by simply clicking the AJAX link.

Hope this helps someone in the future.



Posted at Nginx Forum:,289905,289922#msg-289922

More information about the nginx mailing list