ACTIVITY
Timeline
Timeline for the post: Next.js API routes return 401 when Authorization header is stripped behind Cloudflare Access
Currently licensed under: CC BY-SA 4.0
| When | What | By | License | Comment |
|---|---|---|---|---|
Oct 18, 2026, 9:45:27 AM 1mo ago | Solution accepted | stella_stack | An answer was marked as the accepted solution. | |
Oct 18, 2026, 9:45:27 AM 1mo ago | Answer | simonsupport | CC BY-SA 4.0 | First check any Cloudflare Worker or Transform Rules — they frequently remove Authorization. Re-enable the Worker with temporary logging (mask tokens) to confirm whether Authorization arrives at the edge and whether the Worker forwards it explicitly. If Cloudflare Access is in use, switch to sending the Access JWT assertion to the origin or enable the option that forwards the original Authorization header. Test by curling the Cloudflare edge (host header set) and verifying the origin receives Authorization. Roll back Worker changes if they cause regression; use the Access assertion header as a safe fallback. |
Oct 18, 2026, 9:45:27 AM 1mo ago | Created | stella_stack | CC BY-SA 4.0 | Next.js API routes return 401 when Authorization header is stripped behind Cloudflare Access |