mirror of
https://github.com/bluepuma77/traefik-best-practice.git
synced 2025-12-24 14:31:49 +01:00
Update docker-compose.yml to Traefik v3.1
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
traefik:
|
||||
image: traefik:v3.0
|
||||
image: traefik:v3.1
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
@@ -38,14 +36,15 @@ services:
|
||||
- traefik.http.middlewares.myauth.basicauth.users=test:$$apr1$$H6uskkkW$$IgXLP6ewTrSuBkTrqE8wj/
|
||||
|
||||
whoami:
|
||||
image: traefik/whoami:v1.8
|
||||
image: traefik/whoami:v1.10
|
||||
networks:
|
||||
- proxy
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.mywhoami.rule=Host(`whoami.example.com`) || Host(`www.whoami.example.com`)
|
||||
- traefik.http.services.mywhoami.loadbalancer.server.port=80
|
||||
|
||||
|
||||
# next lines are optional to redirect www to non-www
|
||||
- traefik.http.middlewares.mywwwredirect.redirectregex.regex=^https://www\.(.*)
|
||||
- traefik.http.middlewares.mywwwredirect.redirectregex.replacement=https://$${1}
|
||||
- traefik.http.routers.mywhoami.middlewares=mywwwredirect
|
||||
|
||||
Reference in New Issue
Block a user