Fix OpenClaw "non-loopback Control UI requires allowedOrigins" startup failure
Problem statement: gateway fails to boot with an error stating that non-loopback Control UI requires
gateway.controlUi.allowedOrigins (or fallback mode). Teams hit this during migrations from localhost-only setups
to real domains, reverse proxies, and shared environments.
- OpenClaw issue #34166 (2026-03-04): startup blocked by required allowedOrigins setting.
- Companion issue flow on Control UI routing/availability in current release cycle (#34189, 2026-03-04).
- Community support chatter indicates recurring confusion around origin policy vs host/proxy config in self-hosted installs.
Why this error exists (and why it is good)
This is not a random regression. It is a security boundary. If Control UI is exposed beyond loopback, permissive origin handling can let untrusted sites trigger authenticated browser requests through your operator session. Explicit origins reduce cross-origin abuse and make your deployment policy auditable.
Root-cause model: three configuration layers must agree
- Gateway binding layer: where Control UI is bound (loopback vs non-loopback).
- Origin allowlist layer: which browser origins are explicitly trusted.
- Proxy/domain layer: what domain users actually open in browser and what headers proxy forwards.
Most outages happen when layer 3 changes (new domain, tunnel, proxy rule) but layer 2 remains stale.
Fast diagnosis in 10 minutes
- Capture exact startup error from gateway logs.
- Confirm whether Control UI is intended for localhost only or remote domain access.
- List every domain/origin used by operators (including alternate ports and subdomains).
- Compare that list against
gateway.controlUi.allowedOrigins. - Retest with one canonical domain before adding additional origins.
Secure fix patterns
Pattern A: localhost-only operations (simplest)
If only one operator machine needs Control UI, keep loopback-only binding and avoid non-loopback exposure entirely. This minimizes attack surface and removes most origin complexity.
Pattern B: fixed production domain with explicit allowlist
For team access or remote operations, publish a single canonical HTTPS domain and explicitly allow only that origin. Avoid wildcard thinking. Security policy should mirror real operator behavior, not hypothetical convenience.
{
"gateway": {
"controlUi": {
"enabled": true,
"allowedOrigins": [
"https://ops.example.com"
]
}
}
} Pattern C: temporary emergency bridge (not long-term)
If production is down and you need immediate restoration, fallback mode can unblock startup. Treat it as incident-only. Create a same-day ticket to replace with explicit allowlist.
Step-by-step implementation workflow
- Inventory true access paths. Include direct hostnames, proxy hostnames, and ports.
- Select canonical operator URL. One domain reduces drift and support burden.
- Set allowedOrigins explicitly. Start with one origin; expand only when needed.
- Restart gateway and test preflight. Validate both successful and rejected origins.
- Document policy. Keep allowedOrigins alongside infra runbook and change control.
- Add deploy gate. Fail CI/CD if production domain and allowedOrigins diverge.
Verification matrix (required before closing incident)
- Gateway boots cleanly with no allowedOrigins warning/error.
- Control UI loads from canonical domain and authenticated flows work.
- Disallowed origin is blocked as expected.
- Proxy forwards correct host/proto headers.
- No alternate legacy domain still in operator bookmarks.
Common edge cases and hidden traps
1) HTTP/HTTPS mismatch
Origin includes scheme. http://ops.example.com and https://ops.example.com are different.
Teams often allow one while users open the other.
2) Port mismatch in staging
Non-default ports change origin identity. If staging runs on :8443 but allowlist only has default port origin, requests can fail even though hostname matches.
3) Multiple reverse proxies with inconsistent headers
Header rewriting between edge proxy and internal proxy can produce host/origin confusion. Verify at final gateway ingress, not only at edge.
4) Tunnel URLs rotating frequently
Temporary tunnel domains rotate, forcing repetitive allowlist edits and introducing config drift. For steady operations, move to stable domains or managed hosting.
Operational hardening recommendations
Add these controls to prevent repeated startup outages:
- Single canonical Control UI URL in docs, bookmarks, and incident templates.
- Infrastructure-as-code enforcement for allowedOrigins values.
- Pre-deploy smoke test that executes browser preflight from expected origin.
- Post-deploy alert on origin rejection spikes.
- Quarterly review of legacy domains and unused exposure paths.
Solve origin-policy drift without owning this layer
If your team keeps losing time to Control UI access incidents
This class of problem comes from operating the platform boundary (domains, proxies, origins, upgrades), not from your agent use cases. If that is not your core work, use a managed deployment path that keeps security defaults aligned while your team focuses on workflows and results.
Typical mistakes to avoid
- Using wildcard mentality instead of explicit origins.
- Keeping fallback mode enabled indefinitely after incident recovery.
- Allowing multiple unofficial UI URLs across teams.
- Applying config changes without negative-path tests (blocked origin).
Deep-dive: diagnosing origin failures behind reverse proxies
In many real deployments, OpenClaw sits behind two layers: edge CDN/load balancer and internal reverse proxy. Operators test from browser, see a startup or UI-access error, and assume gateway config is wrong. Often the real issue is header mutation between proxy hops. You need to verify what gateway truly receives, not what edge receives.
- Log incoming host/proto headers at final proxy hop. Confirm values are stable and match canonical URL.
- Check redirect chains. Multiple redirects can silently convert scheme or port, changing effective origin.
- Disable legacy host aliases. Old domains in DNS or bookmarks create policy drift and intermittent failures.
- Test with explicit Origin header probes. Send one allowed and one blocked origin request to ensure policy is enforced as intended.
# Example probe pattern
curl -i 'https://ops.example.com/' -H 'Origin: https://ops.example.com'
curl -i 'https://ops.example.com/' -H 'Origin: https://evil.example.net' If both requests pass, your policy is too permissive. If both fail, your canonical origin path is still misaligned. Fix that before rollout.
Release engineering checklist for origin-safe upgrades
Treat origin policy as part of release quality, not post-release support. A small checklist prevents repetitive outages:
- Pre-upgrade: snapshot current allowedOrigins and active operator URLs.
- Upgrade window: run synthetic browser load from canonical origin.
- Post-upgrade: verify blocked-origin negative test still works.
- Recovery plan: documented rollback or emergency fallback path with owner and expiry time.
- Documentation: update runbook when domains, ports, or proxy topology changes.
FAQ
Do I need to list localhost in allowedOrigins too?
Include only origins you actively use in browser. If operators still use localhost in some contexts, add it explicitly and document why.
Can this break after DNS cutover?
Yes. If canonical hostname changes and allowedOrigins is not updated in the same deployment, gateway startup or UI access can fail.
Is this related to CORS only?
It intersects CORS concerns but is broader: it is about trusted browser-origin entrypoints for Control UI operations and session security.
Sources
Primary query intent: "openclaw non-loopback control ui requires allowedOrigins fix". Recommended next page: /compare/.