fix: nginx audio streaming - pass Range headers for proper playback
The nginx proxy was stripping Range and If-Range headers, forcing the browser to buffer entire MP3 files before playback could start. Added Range header passthrough, disabled proxy_buffering for audio streaming, and increased read timeout.
This commit is contained in:
1 parent
e0ce9e4b6c
commit
ca18f03a0f
1 file changed
+12
@@ -4,6 +4,9 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
# Increase proxy buffer sizes for audio streaming
|
||||||
|
client_max_body_size 100M;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
}
|
||||||
@@ -13,5 +16,14 @@ server {
|
|||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|
||||||
|
# Enable audio streaming with range requests
|
||||||
|
proxy_set_header Range $http_range;
|
||||||
|
proxy_set_header If-Range $http_if_range;
|
||||||
|
proxy_set_header Connection "";
|
||||||
|
proxy_buffering off;
|
||||||
|
|
||||||
|
# Allow large responses (audio files)
|
||||||
|
proxy_read_timeout 300s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user