2019-12-09 17:08:04 +00:00
|
|
|
|
2023-05-10 13:28:05 +00:00
|
|
|
```yaml tab="Docker & Swarm"
|
2019-12-09 17:08:04 +00:00
|
|
|
## Dynamic configuration
|
|
|
|
labels:
|
2020-03-13 21:50:05 +00:00
|
|
|
- traefik.http.routers.blog.rule=Host(`example.com`) && Path(`/blog`)
|
2019-12-09 17:08:04 +00:00
|
|
|
- traefik.http.routers.blog.tls=true
|
2020-02-17 10:04:04 +00:00
|
|
|
- traefik.http.routers.blog.tls.certresolver=myresolver
|
2024-05-27 13:12:03 +00:00
|
|
|
- traefik.http.routers.blog.tls.domains[0].main=example.com
|
2020-03-13 21:50:05 +00:00
|
|
|
- traefik.http.routers.blog.tls.domains[0].sans=*.example.org
|
2019-12-09 17:08:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```yaml tab="Kubernetes"
|
2023-03-20 14:38:08 +00:00
|
|
|
apiVersion: traefik.io/v1alpha1
|
2019-12-09 17:08:04 +00:00
|
|
|
kind: IngressRoute
|
|
|
|
metadata:
|
|
|
|
name: blogtls
|
|
|
|
spec:
|
|
|
|
entryPoints:
|
|
|
|
- websecure
|
|
|
|
routes:
|
2020-03-13 21:50:05 +00:00
|
|
|
- match: Host(`example.com`) && Path(`/blog`)
|
2019-12-09 17:08:04 +00:00
|
|
|
kind: Rule
|
|
|
|
services:
|
|
|
|
- name: blog
|
|
|
|
port: 8080
|
|
|
|
tls:
|
2020-02-17 10:04:04 +00:00
|
|
|
certResolver: myresolver
|
2020-03-04 12:24:05 +00:00
|
|
|
domains:
|
2024-05-27 13:12:03 +00:00
|
|
|
- main: example.com
|
2020-03-04 12:24:05 +00:00
|
|
|
sans:
|
2020-07-03 13:18:03 +00:00
|
|
|
- '*.example.org'
|
2019-12-09 17:08:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
```yaml tab="File (YAML)"
|
|
|
|
## Dynamic configuration
|
|
|
|
http:
|
|
|
|
routers:
|
|
|
|
blog:
|
2020-03-13 21:50:05 +00:00
|
|
|
rule: "Host(`example.com`) && Path(`/blog`)"
|
2019-12-09 17:08:04 +00:00
|
|
|
tls:
|
2020-02-17 10:04:04 +00:00
|
|
|
certResolver: myresolver
|
2019-12-09 17:08:04 +00:00
|
|
|
domains:
|
2024-05-27 13:12:03 +00:00
|
|
|
- main: "example.com"
|
2019-12-09 17:08:04 +00:00
|
|
|
sans:
|
2020-03-13 21:50:05 +00:00
|
|
|
- "*.example.org"
|
2019-12-09 17:08:04 +00:00
|
|
|
```
|
2021-06-18 22:08:08 +00:00
|
|
|
|
|
|
|
```toml tab="File (TOML)"
|
|
|
|
## Dynamic configuration
|
|
|
|
[http.routers]
|
|
|
|
[http.routers.blog]
|
|
|
|
rule = "Host(`example.com`) && Path(`/blog`)"
|
|
|
|
[http.routers.blog.tls]
|
|
|
|
certResolver = "myresolver" # From static configuration
|
|
|
|
[[http.routers.blog.tls.domains]]
|
2024-05-27 13:12:03 +00:00
|
|
|
main = "example.com"
|
2021-06-18 22:08:08 +00:00
|
|
|
sans = ["*.example.org"]
|
|
|
|
```
|