The OpenClaw reverse proxy mistake, and the fix that checks every request
By Christophe Paka · Facts checked on 7 November 2026
You wanted the Control UI from anywhere, so you put a web server in front of the Gateway. The page loads on your phone. It also loads for anyone else who finds the address, with no login.
A Kaspersky scan counted about 1,000 instances open with no login at all. The cause is one wrong assumption in an OpenClaw reverse proxy setup: the Gateway trusts requests that look local. The figure sets the mistake beside the fix, so you can see which one you built.
Only use OpenClaw through chat apps, with no proxy? This mistake cannot happen to you. The check at the bottom still shows whether you are exposed.

Use this diagram on your site
Free to share in your blog post, docs, course or slides, as long as the credit link stays. Paste the code below where the figure should go.
How to read this figure
Start at the top of the left panel. A request comes in from the internet and hits a reverse proxy: a server that receives visitors' requests and passes them on. This one adds no login and forwards each request as is.
See what the Gateway sees. The Gateway is the OpenClaw program that runs your assistant. It waits for visitors at port 18789, a numbered door, and it trusts loopback: requests from its own machine. In the mistake, the proxy hands every request in through
127.0.0.1, the machine's own address. So each stranger arrives looking like the proxy, and the proxy looks local.Read the orange box. Every stranger now looks like a local request. The result is full admin access with no login required: anyone who finds the address controls your assistant, its keys and its tools.
Cross to the fix on the right. Here the proxy overwrites
X-Forwarded-For, a line on each request where a proxy writes the visitor's real address. It must overwrite, not add to, because a visitor can send a fake line of their own. Your proxy's own settings decide this.Check the Gateway's two settings. The Gateway gets two settings in its config file,
~/.openclaw/openclaw.json.auth.mode: trusted-proxytells it to believe a proxy's report.gateway.trustedProxieslists the proxy's exact IP address, the number that names its machine on the network. The Gateway believes the report only from that address, then judges each request by the visitor's real address.Read the green box. Checked, every time. Unlisted proxies are refused, and so are requests without valid auth. A stranger is never mistaken for you. For the safe default without any proxy, see the safe Docker install.
Key takeaways
- Never put a proxy in front of the Gateway that forwards requests as is.
- List your proxy's exact IP in
gateway.trustedProxies, and make it overwriteX-Forwarded-For. - Skip the proxy if you only use chat apps; for the Control UI on your phone, use Tailscale Serve.
Worked example: one stranger, one listed proxy
The OpenClaw docs give an example where the proxy has its own address, 10.0.0.1, listed in gateway.trustedProxies. Follow one stranger's request through it.
- A stranger's request reaches the proxy from the internet.
- The proxy writes the stranger's real address into
X-Forwarded-For, replacing any line the stranger sent. - The Gateway sees the request arrive from
10.0.0.1. That address is on its list, so it reads the forwarded line. - The line says the visitor is not local, so the Gateway asks for valid auth, which the stranger lacks.
Result: The request is refused. A proxy missing from the list is refused too. Either way, no stranger gets in by looking local.
Questions readers ask
How do I reach the OpenClaw Control UI from my phone?
The docs prefer Tailscale Serve. Tailscale is a private network that links your own devices, and Serve keeps the Gateway on loopback, so nothing opens to the internet. The chat apps need no open door on your router at all.
Do I need trusted proxy mode?
Only if the Gateway sits behind a reverse proxy open to the internet. If you use the chat apps or Tailscale Serve, skip it. With it set, the Gateway believes the proxy's report only when it comes from the exact IP address you listed.
How do I check whether my OpenClaw is exposed?
Test it the way a stranger would. Find your public IP address on your router's status page. Switch your phone to mobile data only and open that address on port 18789: it should wait and give up, or be refused. Then run openclaw security audit on the machine and read all of it. It should show no network exposure.
Why does my firewall not block the OpenClaw port in Docker?
Published container ports go through Docker's own rules, so they can slip past a firewall, the filter that allows or blocks network traffic. On Linux with UFW, put your rules in the DOCKER-USER chain, which runs first.
Sources: Network exposure (OpenClaw docs); Docker networking and storage (OpenClaw docs).
This figure is from OpenClaw Made Crystal Clear, chapter 4.
The chapter builds the idea step by step, with recipes you can follow, a Try it to check yourself, and every source.
Get the book


