This commit is contained in:
Yvan
2026-09-23 17:42:55 +08:00
parent 53e8599bdd
commit 0a8ecbe09b
75 changed files with 2299 additions and 276 deletions
+25 -14
View File
@@ -1,8 +1,8 @@
# live.fuhua91.com 宝塔站点配置
# live.fuhua91.com 宝塔站点配置(与 2026-09-21 服务器生效版本一致)
# 路径规划:
# / -> live 用户端前端(静态目录,或替换为反代)
# /admin/ -> 管理后台(frontend 容器 9501,nginx 去前缀转发)
# /api -> 后端 API/WebSocket(backend 容器 9502)
# / -> live 用户端前端(PC 直播页,live-web 容器 9503)
# /admin/ -> 管理后台(frontend 容器 9501,rewrite 去前缀转发)
# /api -> 后端 API/WebSocket(backend 容器 9502,rewrite 去前缀转发)
# 注意: 本文件顶部的 map 位于 http 上下文(宝塔 include 位置),合法。
map $http_upgrade $live_connection_upgrade {
@@ -63,8 +63,9 @@ server
return 404;
}
# 后端 API / WebSocket(容器内后端无 /api 前缀,proxy_pass 尾斜杠自动去掉)
location ^~ /api {
# 后端 API / WebSocket(rewrite 去掉 /api 前缀,后端路由无 /api)
location ^~ /api/ {
rewrite ^/api/(.*)$ /$1 break;
proxy_pass http://127.0.0.1:9502;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
@@ -76,6 +77,14 @@ server
proxy_read_timeout 600s;
proxy_send_timeout 600s;
}
location = /api {
proxy_pass http://127.0.0.1:9502/;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
# 管理后台(frontend 容器;rewrite 去掉 /admin 前缀,前端已按 /admin/ base 构建)
location = /admin {
@@ -91,17 +100,19 @@ server
proxy_set_header X-Forwarded-Proto $scheme;
}
# live 用户端前端(根路径)
# 方式一: 静态文件放 /www/wwwroot/live.fuhua91.com/live-web 后使用当前配置
# 方式二: 若 live 前端也是 docker 容器,把下面两行换成:
# proxy_pass http://127.0.0.1:<live前端端口>;
# proxy_set_header Host $http_host; 以及上面 /admin/ 块中的其余 proxy_set_header
# live 用户端前端(PC 直播页,live-web 容器,主域名根路径)
location / {
root /www/wwwroot/live.fuhua91.com/live-web;
try_files $uri $uri/ /index.html;
proxy_pass http://127.0.0.1:9503;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $live_connection_upgrade;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
#禁止在证书验证目录放入敏感文件
# 禁止在证书验证目录放入敏感文件
if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
return 403;
}