From 40deefa8689bafa0bf3db03928b17e0b7dcac0ed Mon Sep 17 00:00:00 2001 From: Kevin Pollet Date: Fri, 4 Mar 2022 10:50:07 +0100 Subject: [PATCH] Fix HostRegexp examples --- docs/content/routing/routers/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/content/routing/routers/index.md b/docs/content/routing/routers/index.md index fdfc0f6f2..b5445c8b4 100644 --- a/docs/content/routing/routers/index.md +++ b/docs/content/routing/routers/index.md @@ -292,7 +292,7 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul http: routers: Router-1: - rule: "HostRegexp(`.*\.traefik\.com`)" + rule: "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)" # ... Router-2: rule: "Host(`foobar.traefik.com`)" @@ -303,7 +303,7 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul ## Dynamic configuration [http.routers] [http.routers.Router-1] - rule = "HostRegexp(`.*\.traefik\.com`)" + rule = "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)" # ... [http.routers.Router-2] rule = "Host(`foobar.traefik.com`)" @@ -312,10 +312,10 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul In this case, all requests with host `foobar.traefik.com` will be routed through `Router-1` instead of `Router-2`. - | Name | Rule | Priority | - |----------|--------------------------------------|----------| - | Router-1 | ```HostRegexp(`.*\.traefik\.com`)``` | 30 | - | Router-2 | ```Host(`foobar.traefik.com`)``` | 26 | + | Name | Rule | Priority | + |----------|----------------------------------------------------|----------| + | Router-1 | ```HostRegexp(`{subdomain:[a-z]+}.traefik.com`)``` | 30 | + | Router-2 | ```Host(`foobar.traefik.com`)``` | 26 | The previous table shows that `Router-1` has a higher priority than `Router-2`. @@ -328,7 +328,7 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul http: routers: Router-1: - rule: "HostRegexp(`.*\.traefik\.com`)" + rule: "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)" entryPoints: - "web" service: service-1 @@ -345,7 +345,7 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul ## Dynamic configuration [http.routers] [http.routers.Router-1] - rule = "HostRegexp(`.*\.traefik\.com`)" + rule = "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)" entryPoints = ["web"] service = "service-1" priority = 1