Add an option to preserve the ForwardAuth Server Location header

This commit is contained in:
Nelson Isioma 2024-12-13 10:38:37 +01:00 committed by GitHub
parent 4974d9e4d7
commit 2302debac2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 115 additions and 5 deletions

View file

@ -705,4 +705,46 @@ http:
headerField = "X-WebAuth-User"
```
### `preserveLocationHeader`
_Optional, Default=false_
`preserveLocationHeader` defines whether to forward the `Location` header to the client as is or prefix it with the domain name of the authentication server.
```yaml tab="Docker & Swarm"
labels:
- "traefik.http.middlewares.test-auth.forwardauth.preserveLocationHeader=true"
```
```yaml tab="Kubernetes"
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: test-auth
spec:
forwardAuth:
# ...
preserveLocationHeader: true
```
```json tab="Consul Catalog"
- "traefik.http.middlewares.test-auth.forwardauth.preserveLocationHeader=true"
```
```yaml tab="File (YAML)"
http:
middlewares:
test-auth:
forwardAuth:
# ...
preserveLocationHeader: true
```
```toml tab="File (TOML)"
[http.middlewares.test-auth.forwardAuth]
# ...
preserveLocationHeader = true
```
{!traefik-for-business-applications.md!}