Adds middlewares examples for k8s.
This commit is contained in:
parent
336135c392
commit
07d0eb9ae6
16 changed files with 552 additions and 261 deletions
|
@ -11,21 +11,6 @@ Otherwise, the response from the authentication server is returned.
|
|||
|
||||
## Configuration Examples
|
||||
|
||||
```toml tab="File"
|
||||
# Forward authentication to authserver.com
|
||||
[http.middlewares]
|
||||
[http.middlewares.test-auth.forwardauth]
|
||||
address = "https://authserver.com/auth"
|
||||
trustForwardHeader = true
|
||||
authResponseHeaders = ["X-Auth-User", "X-Secret"]
|
||||
|
||||
[http.middlewares.test-auth.forwardauth.tls]
|
||||
ca = "path/to/local.crt"
|
||||
caOptional = true
|
||||
cert = "path/to/foo.cert"
|
||||
key = "path/to/foo.key"
|
||||
```
|
||||
|
||||
```yaml tab="Docker"
|
||||
# Forward authentication to authserver.com
|
||||
labels:
|
||||
|
@ -39,20 +24,54 @@ labels:
|
|||
- "traefik.http.middlewares.test-auth.ForwardAuth.TrustForwardHeader=true"
|
||||
```
|
||||
|
||||
```yaml tab="Kubernetes"
|
||||
apiVersion: traefik.containo.us/v1alpha1
|
||||
kind: Middleware
|
||||
metadata:
|
||||
name: test-auth
|
||||
spec:
|
||||
forwardAuth:
|
||||
address: https://authserver.com/auth
|
||||
trustForwardHeader: true
|
||||
authResponseHeaders:
|
||||
- X-Auth-User
|
||||
- X-Secret
|
||||
tls:
|
||||
ca: path/to/local.crt
|
||||
caOptional: true
|
||||
cert: path/to/foo.cert
|
||||
key: path/to/foo.key
|
||||
```
|
||||
|
||||
```toml tab="File"
|
||||
# Forward authentication to authserver.com
|
||||
[http.middlewares]
|
||||
[http.middlewares.test-auth.forwardAuth]
|
||||
address = "https://authserver.com/auth"
|
||||
trustForwardHeader = true
|
||||
authResponseHeaders = ["X-Auth-User", "X-Secret"]
|
||||
|
||||
[http.middlewares.test-auth.forwardauth.tls]
|
||||
ca = "path/to/local.crt"
|
||||
caOptional = true
|
||||
cert = "path/to/foo.cert"
|
||||
key = "path/to/foo.key"
|
||||
```
|
||||
|
||||
## Configuration Options
|
||||
|
||||
### address
|
||||
### `address`
|
||||
|
||||
The `address` option defines the authentication server address.
|
||||
|
||||
### trustForwardHeader
|
||||
### `trustForwardHeader`
|
||||
|
||||
Set the `trustForwardHeader` option to true to trust all the existing X-Forwarded-* headers.
|
||||
|
||||
### authResponseHeaders
|
||||
### `authResponseHeaders`
|
||||
|
||||
The `authResponseHeaders` option is the list of the headers to copy from the authentication server to the request.
|
||||
|
||||
### tls
|
||||
### `tls`
|
||||
|
||||
The `tls` option is the tls configuration from Traefik to the authentication server.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue