Update nginx.conf
Browse files- nginx.conf +11 -7
nginx.conf
CHANGED
|
@@ -28,14 +28,18 @@ http {
|
|
| 28 |
location / {
|
| 29 |
proxy_pass http://127.0.0.1:8000/stream.mp3;
|
| 30 |
# Buffer settings for streaming might be needed
|
| 31 |
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 32 |
-
proxy_set_header X-Real-IP $remote_addr;
|
| 33 |
-
proxy_set_header Host $http_host;
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
proxy_buffering off;
|
| 37 |
-
proxy_set_header
|
| 38 |
-
|
| 39 |
proxy_read_timeout 86400;
|
| 40 |
}
|
| 41 |
|
|
|
|
| 28 |
location / {
|
| 29 |
proxy_pass http://127.0.0.1:8000/stream.mp3;
|
| 30 |
# Buffer settings for streaming might be needed
|
| 31 |
+
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
| 32 |
+
# proxy_set_header X-Real-IP $remote_addr;
|
| 33 |
+
# proxy_set_header Host $http_host;
|
| 34 |
+
add_header 'Access-Control-Allow-Origin' '*' always;
|
| 35 |
+
add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always;
|
| 36 |
+
add_header 'Access-Control-Allow-Headers' 'Range' always;
|
| 37 |
+
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;
|
| 38 |
+
|
| 39 |
+
# Essential for Icecast/Streaming Stability
|
| 40 |
proxy_buffering off;
|
| 41 |
+
proxy_set_header Host $host;
|
| 42 |
+
chunked_transfer_encoding off; # Some players fail with chunked encoding
|
| 43 |
proxy_read_timeout 86400;
|
| 44 |
}
|
| 45 |
|