Skip to content

Docs: allowed_hosts never lists the name a proxy rewrites Host to - #705

Merged
schmitch merged 1 commit into
mainfrom
schmitch/allowed-hosts-comment-583
Oct 30, 2026
Merged

schmitch merged 1 commit into
mainfrom
schmitch/allowed-hosts-comment-583

Conversation

@schmitch

Copy link
Copy Markdown
Member

Fixes #583

The comment on server.allowed_hosts advised adding "the name a reverse proxy rewrites Host to", for example forge for an nginx proxy_pass http://forge:8421 without proxy_set_header Host $host. With that entry every request names an allowed host, which turns off the trusted-header realms' DNS-rebinding guard. The advice predates 2.1.0 and the removed allowlist mode.

Changes

  • crates/server/src/config.rs and forge.toml.example: the comment now gives an internal client name as its example. It says the guard needs the client's own Host, so the proxy must forward it (nginx: proxy_set_header Host $host). It also says never to add a name the proxy rewrites Host to, because the guard is then off.
  • docs/deployment.md, Trusted-header realms: the bullet on when the headers count says the same, with the nginx example.
  • Changelog: docs/changes/2.2.0/583.docs.md.

The realm form (Admin → Authentication) already says "Forward Forge's own host name", so it is unchanged. docs/docker.md asks to keep Host intact for a repository's host too, so it is unchanged as well.

Checks run

cargo fmt --all --check, cargo build -p forge-server, cargo xtask changelog --check, cargo xtask docs --check.


Generated by Claude Code

The comment on server.allowed_hosts (config.rs, forge.toml.example)
advised adding the name a reverse proxy rewrites Host to. With such a
name every request names an allowed host, and the trusted-header realms'
DNS-rebinding guard is off. The comment now says the proxy must forward
the client's own Host and that a rewritten name must never be listed;
the deployment guide's trusted-header section says the same.

Fixes #583

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012e6DJXRhLYxFjzrWiwKFKc
@schmitch
schmitch enabled auto-merge October 30, 2026 06:42
@schmitch
schmitch added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 286885b Oct 30, 2026
18 checks passed
@schmitch
schmitch deleted the schmitch/allowed-hosts-comment-583 branch October 30, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: the allowed_hosts comment (add the name a proxy rewrites Host to) turns off the trusted-header realm's DNS-rebinding guard

2 participants