docs: fix nginx API 401 example (#3549)

Signed-off-by: Ahmad Srour <asrour@live.com>
This commit is contained in:
Ahmad Srour
2026-09-30 16:55:20 +02:00
committed by GitHub
parent 55824eb0e3
commit 86adcc6c9e
@@ -155,12 +155,11 @@ location @oauth2_signin {
#### API / Machine routes (no redirect)
For API endpoints where clients expect a 401/403 status code (not a redirect):
For API endpoints where clients expect a 401/403 status code (not a redirect), reuse the same `auth_request` header forwarding configuration from the main example as needed for your backend:
```nginx
location /api/ {
auth_request /oauth2/auth;
error_page 401 =401; # Pass through the 401 status
proxy_pass http://backend/;
}
```