git.iko.soy/typeable/oauth2-proxy
on master help sign in
docs: add statusRewrites to Traefik Errors middleware example (#3360)

Add statusRewrites (401 -> 302) to the ForwardAuth with Errors middleware configuration and a troubleshooting note explaining that without it, browsers may show a "Found." link instead of auto-redirecting to the identity provider. Fixes #3359 Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com> Signed-off-by: Jan Larwig <jan@larwig.com> Co-authored-by: Jan Larwig <jan@larwig.com>

commitc6355ee402ac906aca383f21b8794911a1122d64 authorNick Nikolakakis <nonicked@protonmail.com> dateSat 14 Mar 2026, 05:09 (7 months ago) parent6d27221
6 files changed+48
docs/docs/configuration/integrations/traefik.md+8 docs/versioned_docs/version-7.10.x/configuration/integration.md+8 docs/versioned_docs/version-7.11.x/configuration/integration.md+8 docs/versioned_docs/version-7.12.x/configuration/integration.md+8 docs/versioned_docs/version-7.13.x/configuration/integrations/traefik.md+8 docs/versioned_docs/version-7.14.x/configuration/integrations/traefik.md+8
docs/docs/configuration/integrations/traefik.md+8
@@ -79,8 +79,16 @@ http:
7979 - "401-403"
8080 service: oauth-backend
8181 query: "/oauth2/sign_in?rd={url}"
82+ statusRewrites:
83+ "401": 302
8284```
8385
86+:::caution Troubleshooting: Browser shows "Found." instead of redirecting
87+When using the Errors middleware without `statusRewrites`, the redirect response from oauth2-proxy can be served within the original 401/403 status context. This causes some browsers to display a "Found." link instead of automatically following the redirect to the identity provider.
88+
89+Adding `statusRewrites` to rewrite `401 -> 302` ensures the browser treats the response as a proper redirect and follows it automatically.
90+:::
91+
8492### ForwardAuth with static upstreams configuration
8593
8694Redirect to sign_in functionality provided without the use of `errors` middleware with [Traefik v2 `ForwardAuth` middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) pointing to oauth2-proxy service's `/` endpoint
docs/versioned_docs/version-7.10.x/configuration/integration.md+8
@@ -225,8 +225,16 @@ http:
225225 - "401-403"
226226 service: oauth-backend
227227 query: "/oauth2/sign_in?rd={url}"
228+ statusRewrites:
229+ "401": 302
228230```
229231
232+:::info Troubleshooting: Browser shows "Found." instead of redirecting
233+When using the Errors middleware without `statusRewrites`, the redirect response from oauth2-proxy can be served within the original 401/403 status context. This causes some browsers to display a "Found." link instead of automatically following the redirect to the identity provider.
234+
235+Adding `statusRewrites` to rewrite `401 -> 302` ensures the browser treats the response as a proper redirect and follows it automatically.
236+:::
237+
230238### ForwardAuth with static upstreams configuration
231239
232240Redirect to sign_in functionality provided without the use of `errors` middleware with [Traefik v2 `ForwardAuth` middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) pointing to oauth2-proxy service's `/` endpoint
docs/versioned_docs/version-7.11.x/configuration/integration.md+8
@@ -225,8 +225,16 @@ http:
225225 - "401-403"
226226 service: oauth-backend
227227 query: "/oauth2/sign_in?rd={url}"
228+ statusRewrites:
229+ "401": 302
228230```
229231
232+:::info Troubleshooting: Browser shows "Found." instead of redirecting
233+When using the Errors middleware without `statusRewrites`, the redirect response from oauth2-proxy can be served within the original 401/403 status context. This causes some browsers to display a "Found." link instead of automatically following the redirect to the identity provider.
234+
235+Adding `statusRewrites` to rewrite `401 -> 302` ensures the browser treats the response as a proper redirect and follows it automatically.
236+:::
237+
230238### ForwardAuth with static upstreams configuration
231239
232240Redirect to sign_in functionality provided without the use of `errors` middleware with [Traefik v2 `ForwardAuth` middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) pointing to oauth2-proxy service's `/` endpoint
docs/versioned_docs/version-7.12.x/configuration/integration.md+8
@@ -225,8 +225,16 @@ http:
225225 - "401-403"
226226 service: oauth-backend
227227 query: "/oauth2/sign_in?rd={url}"
228+ statusRewrites:
229+ "401": 302
228230```
229231
232+:::info Troubleshooting: Browser shows "Found." instead of redirecting
233+When using the Errors middleware without `statusRewrites`, the redirect response from oauth2-proxy can be served within the original 401/403 status context. This causes some browsers to display a "Found." link instead of automatically following the redirect to the identity provider.
234+
235+Adding `statusRewrites` to rewrite `401 -> 302` ensures the browser treats the response as a proper redirect and follows it automatically.
236+:::
237+
230238### ForwardAuth with static upstreams configuration
231239
232240Redirect to sign_in functionality provided without the use of `errors` middleware with [Traefik v2 `ForwardAuth` middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) pointing to oauth2-proxy service's `/` endpoint
docs/versioned_docs/version-7.13.x/configuration/integrations/traefik.md+8
@@ -79,8 +79,16 @@ http:
7979 - "401-403"
8080 service: oauth-backend
8181 query: "/oauth2/sign_in?rd={url}"
82+ statusRewrites:
83+ "401": 302
8284```
8385
86+:::info Troubleshooting: Browser shows "Found." instead of redirecting
87+When using the Errors middleware without `statusRewrites`, the redirect response from oauth2-proxy can be served within the original 401/403 status context. This causes some browsers to display a "Found." link instead of automatically following the redirect to the identity provider.
88+
89+Adding `statusRewrites` to rewrite `401 -> 302` ensures the browser treats the response as a proper redirect and follows it automatically.
90+:::
91+
8492### ForwardAuth with static upstreams configuration
8593
8694Redirect to sign_in functionality provided without the use of `errors` middleware with [Traefik v2 `ForwardAuth` middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) pointing to oauth2-proxy service's `/` endpoint
docs/versioned_docs/version-7.14.x/configuration/integrations/traefik.md+8
@@ -79,8 +79,16 @@ http:
7979 - "401-403"
8080 service: oauth-backend
8181 query: "/oauth2/sign_in?rd={url}"
82+ statusRewrites:
83+ "401": 302
8284```
8385
86+:::info Troubleshooting: Browser shows "Found." instead of redirecting
87+When using the Errors middleware without `statusRewrites`, the redirect response from oauth2-proxy can be served within the original 401/403 status context. This causes some browsers to display a "Found." link instead of automatically following the redirect to the identity provider.
88+
89+Adding `statusRewrites` to rewrite `401 -> 302` ensures the browser treats the response as a proper redirect and follows it automatically.
90+:::
91+
8492### ForwardAuth with static upstreams configuration
8593
8694Redirect to sign_in functionality provided without the use of `errors` middleware with [Traefik v2 `ForwardAuth` middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) pointing to oauth2-proxy service's `/` endpoint