Skip to content

fix: support controlUi connection when deployed behind reverse proxy#4

Open
smalloshin wants to merge 9 commits intoallen-hsu:mainfrom
smalloshin:fix/reverse-proxy-origin-not-allowed
Open

fix: support controlUi connection when deployed behind reverse proxy#4
smalloshin wants to merge 9 commits intoallen-hsu:mainfrom
smalloshin:fix/reverse-proxy-origin-not-allowed

Conversation

@smalloshin
Copy link

When ClawHuddle is deployed behind a reverse proxy (e.g. Traefik) with a wildcard subdomain (e.g. *.gw.example.com), the Control UI fails with 'origin not allowed' because:

  1. allowedOrigins: ["*"] is NOT treated as a wildcard by OpenClaw
  2. The browser sends the gateway subdomain as the Origin header (e.g. https://claw-abc123.gw.example.com\), which doesn't match any hardcoded entry in allowedOrigins

Fix:

  • Add dangerouslyAllowHostHeaderOriginFallback: true so OpenClaw uses the Host header as the origin (matches in proxy setups)
  • Add dangerouslyDisableDeviceAuth: true for consistent behavior when the UI is served behind a TLS-terminating proxy
  • Widen trustedProxies to cover all 172.x Docker bridge networks
  • Add the missing interface fields to OpenClawConfig type

When ClawHuddle is deployed behind a reverse proxy (e.g. Traefik) with
a wildcard subdomain (e.g. *.gw.example.com), the Control UI fails with
'origin not allowed' because:

1. allowedOrigins: ["*"] is NOT treated as a wildcard by OpenClaw
2. The browser sends the gateway subdomain as the Origin header
   (e.g. https://claw-abc123.gw.example.com\), which doesn't match
   any hardcoded entry in allowedOrigins

Fix:
- Add dangerouslyAllowHostHeaderOriginFallback: true so OpenClaw
  uses the Host header as the origin (matches in proxy setups)
- Add dangerouslyDisableDeviceAuth: true for consistent behavior
  when the UI is served behind a TLS-terminating proxy
- Widen trustedProxies to cover all 172.x Docker bridge networks
- Add the missing interface fields to OpenClawConfig type
@smalloshin smalloshin force-pushed the fix/reverse-proxy-origin-not-allowed branch from f04225b to 1be4a45 Compare March 2, 2026 13:13
@smalloshin smalloshin force-pushed the fix/reverse-proxy-origin-not-allowed branch from 1be4a45 to 9407d21 Compare March 11, 2026 02:44
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.

1 participant