Allow to define default entrypoints (for HTTP/TCP)
This commit is contained in:
parent
a5c520664a
commit
188ef84c4f
9 changed files with 163 additions and 13 deletions
|
@ -233,6 +233,54 @@ If both TCP and UDP are wanted for the same port, two entryPoints definitions ar
|
|||
|
||||
Full details for how to specify `address` can be found in [net.Listen](https://golang.org/pkg/net/#Listen) (and [net.Dial](https://golang.org/pkg/net/#Dial)) of the doc for go.
|
||||
|
||||
### AsDefault
|
||||
|
||||
_Optional, Default=false_
|
||||
|
||||
The `AsDefault` option marks the EntryPoint to be in the list of default EntryPoints.
|
||||
EntryPoints in this list are used (by default) on HTTP and TCP routers that do not define their own [EntryPoints option](./routers/index.md#entrypoints).
|
||||
|
||||
!!! info "List of default EntryPoints"
|
||||
|
||||
If there is no EntryPoint with the `AsDefault` option set to `true`,
|
||||
then the list of default EntryPoints includes all HTTP/TCP EntryPoints.
|
||||
|
||||
If at least one EntryPoint has the `AsDefault` option set to `true`,
|
||||
then the list of default EntryPoints includes only EntryPoints that have the `AsDefault` option set to `true`.
|
||||
|
||||
Some built-in EntryPoints are always excluded from the list, namely: `traefik`, `traefikhub-api`, and `traefikhub-tunl`.
|
||||
|
||||
!!! warning "Only TCP and HTTP"
|
||||
|
||||
The `AsDefault` option has no effect on UDP EntryPoints.
|
||||
When a UDP router does not define the [EntryPoints option](./routers/index.md#entrypoints_2),
|
||||
it is attached to all available UDP EntryPoints.
|
||||
|
||||
??? example "Defining only one EntryPoint as default"
|
||||
|
||||
```yaml tab="File (yaml)"
|
||||
entryPoints:
|
||||
web:
|
||||
address: ":80"
|
||||
websecure:
|
||||
address: ":443"
|
||||
asDefault: true
|
||||
```
|
||||
|
||||
```toml tab="File (TOML)"
|
||||
[entryPoints.web]
|
||||
address = ":80"
|
||||
[entryPoints.websecure]
|
||||
address = ":443"
|
||||
asDefault = true
|
||||
```
|
||||
|
||||
```bash tab="CLI"
|
||||
--entrypoints.web.address=:80
|
||||
--entrypoints.websecure.address=:443
|
||||
--entrypoints.websecure.asDefault=true
|
||||
```
|
||||
|
||||
### HTTP/2
|
||||
|
||||
#### `maxConcurrentStreams`
|
||||
|
|
|
@ -94,7 +94,7 @@ or act before forwarding the request to the service.
|
|||
|
||||
### EntryPoints
|
||||
|
||||
If not specified, HTTP routers will accept requests from all defined entry points.
|
||||
If not specified, HTTP routers will accept requests from all EntryPoints in the [list of default EntryPoints](../entrypoints.md#asdefault).
|
||||
If you want to limit the router scope to a set of entry points, set the `entryPoints` option.
|
||||
|
||||
??? example "Listens to Every EntryPoint"
|
||||
|
@ -106,7 +106,7 @@ If you want to limit the router scope to a set of entry points, set the `entryPo
|
|||
http:
|
||||
routers:
|
||||
Router-1:
|
||||
# By default, routers listen to every entry points
|
||||
# By default, routers listen to every EntryPoints.
|
||||
rule: "Host(`example.com`)"
|
||||
service: "service-1"
|
||||
```
|
||||
|
@ -115,7 +115,7 @@ If you want to limit the router scope to a set of entry points, set the `entryPo
|
|||
## Dynamic configuration
|
||||
[http.routers]
|
||||
[http.routers.Router-1]
|
||||
# By default, routers listen to every entry points
|
||||
# By default, routers listen to every EntryPoints.
|
||||
rule = "Host(`example.com`)"
|
||||
service = "service-1"
|
||||
```
|
||||
|
@ -666,12 +666,12 @@ The [supported `provider` table](../../https/acme.md#providers) indicates if the
|
|||
|
||||
### General
|
||||
|
||||
If both HTTP routers and TCP routers listen to the same entry points, the TCP routers will apply *before* the HTTP routers.
|
||||
If both HTTP routers and TCP routers listen to the same EntryPoint, the TCP routers will apply *before* the HTTP routers.
|
||||
If no matching route is found for the TCP routers, then the HTTP routers will take over.
|
||||
|
||||
### EntryPoints
|
||||
|
||||
If not specified, TCP routers will accept requests from all defined entry points.
|
||||
If not specified, TCP routers will accept requests from all EntryPoints in the [list of default EntryPoints](../entrypoints.md#asdefault)..
|
||||
If you want to limit the router scope to a set of entry points, set the entry points option.
|
||||
|
||||
??? info "How to handle Server First protocols?"
|
||||
|
@ -699,7 +699,7 @@ If you want to limit the router scope to a set of entry points, set the entry po
|
|||
tcp:
|
||||
routers:
|
||||
Router-1:
|
||||
# By default, routers listen to every entrypoints
|
||||
# By default, routers listen to every EntryPoints.
|
||||
rule: "HostSNI(`example.com`)"
|
||||
service: "service-1"
|
||||
# will route TLS requests (and ignore non tls requests)
|
||||
|
@ -711,7 +711,7 @@ If you want to limit the router scope to a set of entry points, set the entry po
|
|||
|
||||
[tcp.routers]
|
||||
[tcp.routers.Router-1]
|
||||
# By default, routers listen to every entrypoints
|
||||
# By default, routers listen to every EntryPoints.
|
||||
rule = "HostSNI(`example.com`)"
|
||||
service = "service-1"
|
||||
# will route TLS requests (and ignore non tls requests)
|
||||
|
@ -751,7 +751,7 @@ If you want to limit the router scope to a set of entry points, set the entry po
|
|||
--entrypoints.other.address=:9090
|
||||
```
|
||||
|
||||
??? example "Listens to Specific Entry Points"
|
||||
??? example "Listens to Specific EntryPoints"
|
||||
|
||||
**Dynamic Configuration**
|
||||
|
||||
|
@ -1198,12 +1198,12 @@ So UDP "routers" at this time are pretty much only load-balancers in one form or
|
|||
As expected, a `timeout` is associated to each of these sessions,
|
||||
so that they get cleaned out if they go through a period of inactivity longer than a given duration.
|
||||
Timeout can be configured using the `entryPoints.name.udp.timeout` option as described
|
||||
under [entry points](../entrypoints/#udp-options).
|
||||
under [EntryPoints](../entrypoints/#udp-options).
|
||||
|
||||
### EntryPoints
|
||||
|
||||
If not specified, UDP routers will accept packets from all defined (UDP) entry points.
|
||||
If one wants to limit the router scope to a set of entry points, one should set the entry points option.
|
||||
If not specified, UDP routers will accept packets from all defined (UDP) EntryPoints.
|
||||
If one wants to limit the router scope to a set of EntryPoints, one should set the `entryPoints` option.
|
||||
|
||||
??? example "Listens to Every Entry Point"
|
||||
|
||||
|
@ -1267,7 +1267,7 @@ If one wants to limit the router scope to a set of entry points, one should set
|
|||
--entrypoints.streaming.address=":9191/udp"
|
||||
```
|
||||
|
||||
??? example "Listens to Specific Entry Points"
|
||||
??? example "Listens to Specific EntryPoints"
|
||||
|
||||
**Dynamic Configuration**
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue