fix(web): 保留代理端口以修复同源质量查询误拒绝
build / build (push) Successful in 1m1s

Nginx 使用原始 Host 和端口转发,不修改后端跨站防护。补充无 Fetch Metadata 的 LAN/Tailscale 同源和异源、异端口、转发头伪造回归。

验证:配置回归先因丢失端口失败后通过;HTTP竞态、真实隔离Nginx正反例及完整make verify均通过。部署前真实入口无Metadata为403,同源Metadata对照可过;源库及人工复核无写入。
This commit is contained in:
姚章浩
2026-10-18 15:45:09 +08:00
parent 828c2c5fa0
commit 2ea2111420
3 changed files with 66 additions and 2 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ server {
set $api_upstream http://api:8080;
proxy_pass $api_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
@@ -22,7 +22,7 @@ server {
location = /health {
set $health_upstream http://api:8080;
proxy_pass $health_upstream/health;
proxy_set_header Host $host;
proxy_set_header Host $http_host;
}
# 带内容哈希的构建产物:可以长期缓存(换版本必然换文件名);旧哈希文件已被新构建替换