修复工作

This commit is contained in:
2025-09-30 21:12:52 +08:00
parent 9e36a84354
commit b4e8cf5c33

View File

@@ -47,26 +47,55 @@ server {
# 视频流代理HTTP-FLVbackend使用host网络 # 视频流代理HTTP-FLVbackend使用host网络
location /live { location /live {
proxy_pass http://127.0.0.1:8866/live; proxy_pass http://127.0.0.1:8866;
proxy_http_version 1.1; proxy_http_version 1.1;
# 重要:禁用所有缓冲,实时传输视频流
proxy_buffering off;
proxy_cache off;
proxy_request_buffering off;
chunked_transfer_encoding on;
# 设置超时时间(视频流长连接)
proxy_connect_timeout 60s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
# 请求头
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;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Connection ""; proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off; # CORS支持
chunked_transfer_encoding off; add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers '*';
} }
# 视频流代理HLS # 视频流代理HLS
location /hls { location /hls {
proxy_pass http://127.0.0.1:8866/hls; proxy_pass http://127.0.0.1:8866;
proxy_http_version 1.1; proxy_http_version 1.1;
# HLS也需要禁用缓冲
proxy_buffering off;
proxy_cache off;
proxy_request_buffering off;
# 超时设置
proxy_connect_timeout 60s;
proxy_send_timeout 3600s;
proxy_read_timeout 3600s;
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;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_cache off; # CORS支持
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers '*';
} }
# MinIO使用外部服务不需要代理 # MinIO使用外部服务不需要代理