Fix HostRegexp examples

This commit is contained in:
Kevin Pollet 2022-03-04 10:50:07 +01:00 committed by GitHub
parent 491de0cf64
commit 40deefa868
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,7 +292,7 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul
http: http:
routers: routers:
Router-1: Router-1:
rule: "HostRegexp(`.*\.traefik\.com`)" rule: "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)"
# ... # ...
Router-2: Router-2:
rule: "Host(`foobar.traefik.com`)" 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 ## Dynamic configuration
[http.routers] [http.routers]
[http.routers.Router-1] [http.routers.Router-1]
rule = "HostRegexp(`.*\.traefik\.com`)" rule = "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)"
# ... # ...
[http.routers.Router-2] [http.routers.Router-2]
rule = "Host(`foobar.traefik.com`)" 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`. In this case, all requests with host `foobar.traefik.com` will be routed through `Router-1` instead of `Router-2`.
| Name | Rule | Priority | | Name | Rule | Priority |
|----------|--------------------------------------|----------| |----------|----------------------------------------------------|----------|
| Router-1 | ```HostRegexp(`.*\.traefik\.com`)``` | 30 | | Router-1 | ```HostRegexp(`{subdomain:[a-z]+}.traefik.com`)``` | 30 |
| Router-2 | ```Host(`foobar.traefik.com`)``` | 26 | | Router-2 | ```Host(`foobar.traefik.com`)``` | 26 |
The previous table shows that `Router-1` has a higher priority than `Router-2`. 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: http:
routers: routers:
Router-1: Router-1:
rule: "HostRegexp(`.*\.traefik\.com`)" rule: "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)"
entryPoints: entryPoints:
- "web" - "web"
service: service-1 service: service-1
@ -345,7 +345,7 @@ A value of `0` for the priority is ignored: `priority = 0` means that the defaul
## Dynamic configuration ## Dynamic configuration
[http.routers] [http.routers]
[http.routers.Router-1] [http.routers.Router-1]
rule = "HostRegexp(`.*\.traefik\.com`)" rule = "HostRegexp(`{subdomain:[a-z]+}.traefik.com`)"
entryPoints = ["web"] entryPoints = ["web"]
service = "service-1" service = "service-1"
priority = 1 priority = 1