修复工作

This commit is contained in:
2025-09-30 20:27:56 +08:00
parent e77a2f7cff
commit 1f22d777e9
4 changed files with 30 additions and 2 deletions

View File

@@ -44,6 +44,29 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
# 视频流代理HTTP-FLV
location /live {
proxy_pass http://rtsp-backend:8866/live;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Connection "";
proxy_buffering off;
proxy_cache off;
}
# 视频流代理HLS
location /hls {
proxy_pass http://rtsp-backend:8866/hls;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_buffering off;
proxy_cache off;
}
# MinIO使用外部服务不需要代理
# 错误页面配置

View File

@@ -68,7 +68,8 @@ onMounted(() => {
const getDetails = async (deviceId) => {
const res = await getDevice(deviceId);
tableData.value = res.data;
playUrl.value = `http://localhost:8866/live?url=${tableData.value.url}`;
// 使用当前访问的域名和端口通过Nginx代理访问视频流
playUrl.value = `${window.location.origin}/live?url=${tableData.value.url}`;
handlePlay();
}