mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-10-18 13:18:26 +02:00
docs: fix nginx API 401 example (#3549)
Signed-off-by: Ahmad Srour <asrour@live.com>
This commit is contained in:
@@ -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/;
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user