Why this matters beyond the homelab: A 401 with an unknown security action is an upstream layer speaking, not the defense you are staring at. Find which layer produced the response before changing any rule, and test from outside the network, because internal success only proves the application.
The Symptom
I had deployed Umami to track pageviews on the portfolio, behind a Cloudflare Tunnel route on analytics.tima.dev. From outside the network, requests for /script.js and /api/send came back as HTTP 401 with an empty body. From inside the network they worked. No WAF rule and no bot rule explained it.
The Wrong Suspects
The first three checks were the obvious ones: the zone’s WAF custom rules, Bot Fight Mode, and the Access Applications list. Applications was empty. Nothing in the zone matched the request.
Internal success was a trap. A DNS rewrite sends internal clients straight to the reverse proxy, so those tests never touched the tunnel or Cloudflare Access. They proved the application was healthy and said nothing about the path.
The Evidence
Cloudflare’s Security Events had an entry for the failing request:
originResponseStatus: 401
securityAction: unknown
A WAF or bot decision would have named its action. A 401 logged with an unknown action means Cloudflare’s edge was relaying a response generated somewhere else.
The reverse proxy’s access log settled where. With the log open and the external request repeating, every line came from the internal client. Eight minutes after the Cloudflare event, no external request had reached the proxy at all. The 401 was produced before the origin, on Cloudflare’s side of the tunnel.
The Cause
The route had been created through the tunnel’s Published application flow. A route made that way behaved as an Access-protected endpoint, so every unauthenticated external request was rejected at the edge, and the policy did not appear in the Applications list I had been checking.
A second fault was hiding behind the first. After the first fix, the route table showed this:
1 analytics.tima.dev Published application http://<adguard-host> Using defaults
The service URL pointed at the AdGuard host, not the reverse proxy. Internal tests had never exercised it.
The Fix
I deleted the route, which also removed its DNS record, and added it again as a plain published application with no Access policy. Then I corrected the service URL to point at the reverse proxy, and turned on Match SNI to host. The proxy had been rejecting the TLS handshake with “unrecognized name” when the SNI was a raw IP address.
While the tunnel was broken I served the tracking script from the site itself to keep pageviews flowing. Once the route worked I changed the layout back to the direct script URL and deleted the self-hosted copy. I confirmed the result by loading the portfolio from an outside device and watching pageviews arrive.
Takeaways
A 401 with an unknown security action points at the tunnel, not the WAF. The defense that blocks you names itself.
Wizards leave side effects. Check what a setup flow attached, not only what you asked for.
An origin addressed by IP needs an SNI override. Otherwise a name-based proxy rejects the handshake.
Test from outside the network. Internal success proves the application, not the path.
Related: Three Layers Between a Browser and an S3 Bucket | The DNS Rule That Caught Its Own Resolver | The Alliance Fleet, Reintroduced