alireza0:s-ui 反代 403 源于 header_up 改写 Host,应删除该行由 Caddy 转发原始 Host

在 s-ui issue #1290(反向代理配置问题,已关闭)中,alireza0 说明 403 的来源是 Caddy 的 `header_up Host {upstream_hostport}`:它把 Host 头改写成 `127.0.0.1:20000`,因此面板设置里若配了域名,域名校验会拒绝每个请求并返回 403;即便没有配域名,登录也会被拒绝,因为浏览器的 Origin(如 example.com)与 Host 不再匹配。他要求删除这一行,Caddy 默认会转发原始 Host,并给出配置示例 `:443, example.com:443 { route { reverse_proxy /dashboard/* 127.0.0.1:20000 } }`;同时指出 changelog 的说明只针对 `X-Forwarded-*` 头,回环上的 Caddy 本身已被信任。

作者原文

The 403 comes from header_up Host {upstream_hostport}.
It rewrites the Host header to 127.0.0.1:20000, so:

  • if a domain is set in the panel settings, the domain check rejects every request with 403;
  • even without one, login is rejected because the browser's Origin (example.com) no longer matches the Host.

Please remove that line. Caddy forwards the original Host by default:

:443, example.com:443 {
route {
reverse_proxy /dashboard/* 127.0.0.1:20000
}
}

The changelog note is only about X-Forwarded-* headers. Caddy on loopback is already trusted.