401 because the Authorization header is stripped
The client sends credentials, but a proxy, CGI/FastCGI setup or redirect removes the Authorization header before your app sees it.
Authorization header not receivedAuthorization header strippedHTTP_AUTHORIZATION not set401 Unauthorized Authorization header missing in PHPgetallheaders Authorization missing Meaning
Apache with PHP-FPM/CGI drops it unless you pass it through; redirects to another host also strip it by design. Add a rewrite rule to forward the header, use proxy_set_header Authorization $http_authorization, and avoid cross-origin redirects for authenticated calls.
Common causes
- Apache CGI/FastCGI not forwarding Authorization
- Proxy not passing the header
- Cross-origin redirect stripping credentials
- CDN rule removing headers
- Header name filtered by WAF
⚡ Quick fix
- Apache:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] - nginx:
proxy_set_header Authorization $http_authorization; - Call the final URL, not a redirecting one
Detailed fix by platform
Apache
- apache
RewriteEngine On RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
How to diagnose
- App sees header — No?
- Proxy — Forwards it?
- Redirect — Cross-origin?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in HTTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 18 Nov 2026