# 401 because the Authorization header is stripped

**Code:** `401` · **Category:** HTTP · **Seen on:** HTTP, Apache, PHP, Nginx

The client sends credentials, but a proxy, CGI/FastCGI setup or redirect removes the Authorization header before your app sees it.

## 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

1. Apache: `RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]`
2. nginx: `proxy_set_header Authorization $http_authorization;`
3. Call the final URL, not a redirecting one

## Detailed fix by platform

### Apache

1. 

```apache
RewriteEngine On
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
```


## How to diagnose

1. **App sees header** — No?
2. **Proxy** — Forwards it?
3. **Redirect** — Cross-origin?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/http/401-authorization-header-stripped)
