From bb35197d5acfe97e37f68200a0933da9c4a463d3 Mon Sep 17 00:00:00 2001 From: Sheddy Date: Fri, 16 Jan 2026 14:48:06 +0100 Subject: [PATCH] Improve the structure of the routing reference pages --- .../other-providers/consul-catalog.md | 617 +++++------------- .../other-providers/docker.md | 547 +++------------- .../other-providers/ecs.md | 601 +++++------------ .../other-providers/kv.md | 94 +-- .../other-providers/nomad.md | 614 +++++------------ .../other-providers/swarm.md | 547 +++------------- 6 files changed, 727 insertions(+), 2293 deletions(-) diff --git a/docs/content/reference/routing-configuration/other-providers/consul-catalog.md b/docs/content/reference/routing-configuration/other-providers/consul-catalog.md index 7958a4c01..9a9a2dd8e 100644 --- a/docs/content/reference/routing-configuration/other-providers/consul-catalog.md +++ b/docs/content/reference/routing-configuration/other-providers/consul-catalog.md @@ -13,7 +13,90 @@ With Consul Catalog, Traefik can leverage tags attached to a service to generate We recommend to *not* use tags to store sensitive data (certificates, credentials, etc). Instead, we recommend to store sensitive data in a safer storage (secrets, file, etc). -## Routing Configuration +## Configuration Examples + +??? example "Configuring Consul Catalog & Deploying / Exposing one Service" + + Enabling the consul catalog provider + + ```yaml tab="Structured (YAML)" + providers: + consulCatalog: {} + ``` + + ```toml tab="Structured (TOML)" + [providers.consulCatalog] + ``` + + ```bash tab="CLI" + --providers.consulcatalog=true + ``` + + Attaching tags to services (when registering a service in Consul) + + ```bash + consul services register -name=my-service -tag="traefik.http.routers.my-service.rule=Host(`example.com`)" + ``` + + Or using a service definition file: + + ```json + { + "service": { + "name": "my-service", + "tags": [ + "traefik.http.routers.my-service.rule=Host(`example.com`)" + ] + } + } + ``` + +??? example "Specify a Custom Port for the Container" + + Forward requests for `http://example.com` to `http://:12345`: + + ```json + { + "service": { + "name": "my-service", + "tags": [ + "traefik.http.routers.my-service.rule=Host(`example.com`)", + "traefik.http.routers.my-service.service=my-service", + "traefik.http.services.my-service.loadbalancer.server.port=12345" + ] + } + } + ``` + + !!! important "Traefik Connecting to the Wrong Port: `HTTP/502 Gateway Error`" + By default, Traefik uses the first exposed port of a container. + + Setting the tag `traefik.http.services.xxx.loadbalancer.server.port` + overrides that behavior. + +??? example "Specifying more than one router and service per container" + + Forwarding requests to more than one port on a container requires referencing the service loadbalancer port definition using the service parameter on the router. + + In this example, requests are forwarded for `http://example-a.com` to `http://:8000` in addition to `http://example-b.com` forwarding to `http://:9000`: + + ```json + { + "service": { + "name": "my-service", + "tags": [ + "traefik.http.routers.www-router.rule=Host(`example-a.com`)", + "traefik.http.routers.www-router.service=www-service", + "traefik.http.services.www-service.loadbalancer.server.port=8000", + "traefik.http.routers.admin-router.rule=Host(`example-b.com`)", + "traefik.http.routers.admin-router.service=admin-service", + "traefik.http.services.admin-service.loadbalancer.server.port=9000" + ] + } + } + ``` + +## Configuration Options !!! info "tags" @@ -35,120 +118,24 @@ To update the configuration of the Router automatically attached to the service, For example, to change the rule, you could add the tag ```traefik.http.routers.my-service.rule=Host(`example.com`)```. -??? info "`traefik.http.routers..rule`" - - See [rule](../http/routing/rules-and-priority.md) for more information. - - ```yaml - traefik.http.routers.myrouter.rule=Host(`example.com`) - ``` +#### Configuration Options -??? info "`traefik.http.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information. - - ```yaml - traefik.http.routers.myrouter.ruleSyntax=v3 - ``` - -??? info "`traefik.http.routers..priority`" - - See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.priority=42" - ``` - -??? info "`traefik.http.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.http.routers.myrouter.entrypoints=web,websecure - ``` - -??? info "`traefik.http.routers..middlewares`" - - See [middlewares overview](../http/middlewares/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.middlewares=auth,prefix,cb - ``` - -??? info "`traefik.http.routers..service`" - - See [service](../http/load-balancing/service.md) for more information. - - ```yaml - traefik.http.routers.myrouter.service=myservice - ``` - -??? info "`traefik.http.routers..tls`" - - See [tls](../http/tls/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.tls=true - ``` - -??? info "`traefik.http.routers..tls.certresolver`" - - See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.certresolver=myresolver - ``` - -??? info "`traefik.http.routers..tls.domains[n].main`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.domains[0].main=example.org - ``` - -??? info "`traefik.http.routers..tls.domains[n].sans`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.domains[0].sans=test.example.org,dev.example.org - ``` - -??? info "`traefik.http.routers..tls.options`" - - ```yaml - traefik.http.routers.myrouter.tls.options=foobar - ``` - -??? info "`traefik.http.routers..observability.accesslogs`" - - The accessLogs option controls whether the router will produce access-logs. - - ```yaml - "traefik.http.routers.myrouter.observability.accesslogs=true" - ``` - -??? info "`traefik.http.routers..observability.metrics`" - - The metrics option controls whether the router will produce metrics. - - ```yaml - "traefik.http.routers.myrouter.observability.metrics=true" - ``` - -??? info "`traefik.http.routers..observability.tracing`" - - The tracing option controls whether the router will produce traces. - - ```yaml - "traefik.http.routers.myrouter.observability.tracing=true" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.routers..rule` | See [rule](../http/routing/rules-and-priority.md#rules) for more information. | ```Host(`example.com`)``` | +| `traefik.http.routers..ruleSyntax` | See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.http.routers..priority` | See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | +| `traefik.http.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `web,websecure` | +| `traefik.http.routers..middlewares` | See [middlewares overview](../http/middlewares/overview.md) for more information. | `auth,prefix,cb` | +| `traefik.http.routers..service` | See [service](../http/load-balancing/service.md) for more information. | `myservice` | +| `traefik.http.routers..tls` | See [tls](../http/tls/overview.md) for more information. | `true` | +| `traefik.http.routers..tls.certresolver` | See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. | `myresolver` | +| `traefik.http.routers..tls.domains[n].main` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `example.org` | +| `traefik.http.routers..tls.domains[n].sans` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `test.example.org,dev.example.org` | +| `traefik.http.routers..tls.options` | | `foobar` | +| `traefik.http.routers..observability.accesslogs` | The accessLogs option controls whether the router will produce access-logs. | `true` | +| `traefik.http.routers..observability.metrics` | The metrics option controls whether the router will produce metrics. | `true` | +| `traefik.http.routers..observability.tracing` | The tracing option controls whether the router will produce traces. | `true` | ### Services @@ -158,181 +145,34 @@ add tags starting with `traefik.http.services.{name-of-your-choice}.`, followed For example, to change the `passHostHeader` behavior, you'd add the tag `traefik.http.services.{name-of-your-choice}.loadbalancer.passhostheader=false`. -??? info "`traefik.http.services..loadbalancer.server.port`" - - Registers a port. - Useful when the service exposes multiples ports. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.port=8080 - ``` +#### Configuration Options -??? info "`traefik.http.services..loadbalancer.server.scheme`" - - Overrides the default scheme. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.scheme=http - ``` - -??? info "`traefik.http.services..loadbalancer.server.weight`" - - Overrides the default weight. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.weight=42 - ``` - -??? info "`traefik.http.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../http/load-balancing/serverstransport.md) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.serverstransport=foobar@file - ``` - -??? info "`traefik.http.services..loadbalancer.passhostheader`" - - ```yaml - traefik.http.services.myservice.loadbalancer.passhostheader=true - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.headers.`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.headers.X-Foo=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.hostname`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.hostname=example.org - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.interval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.interval=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.unhealthyinterval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.unhealthyinterval=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.path`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.path=/foo - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.method`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.method=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.status`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.status=42 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.port`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.port=42 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.scheme`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.scheme=http - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.timeout`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.timeout=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.followredirects`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.followredirects=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.httponly`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.httponly=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.name`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.name=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.path`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.path=/foobar - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.secure`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.secure=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.samesite`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.samesite=none - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.maxage`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.maxage=42 - ``` - -??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - ```yaml - traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10 - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.services..loadbalancer.server.port` | Registers a port.
Useful when the service exposes multiples ports. | `8080` | +| `traefik.http.services..loadbalancer.server.scheme` | Overrides the default scheme. | `http` | +| `traefik.http.services..loadbalancer.server.weight` | Overrides the default weight. | `42` | +| `traefik.http.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../http/load-balancing/serverstransport.md) for more information. | `foobar@file` | +| `traefik.http.services..loadbalancer.passhostheader` | | `true` | +| `traefik.http.services..loadbalancer.healthcheck.headers.` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.hostname` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `example.org` | +| `traefik.http.services..loadbalancer.healthcheck.interval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.unhealthyinterval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.path` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `/foo` | +| `traefik.http.services..loadbalancer.healthcheck.method` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.status` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.port` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.scheme` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `http` | +| `traefik.http.services..loadbalancer.healthcheck.timeout` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.followredirects` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.httponly` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.name` | | `foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.path` | | `/foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.secure` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.samesite` | | `none` | +| `traefik.http.services..loadbalancer.sticky.cookie.maxage` | | `42` | +| `traefik.http.services..loadbalancer.responseforwarding.flushinterval` | | `10` | ### Middleware @@ -375,124 +215,32 @@ You can declare TCP Routers, Middlewares and/or Services using tags. #### TCP Routers -??? info "`traefik.tcp.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.entrypoints=ep1,ep2 - ``` +##### Configuration Options -??? info "`traefik.tcp.routers..rule`" - - See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.rule=HostSNI(`example.com`) - ``` - -??? info "`traefik.tcp.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - configure the rule syntax to be used for parsing the rule on a per-router basis. - - ```yaml - traefik.tcp.routers.mytcprouter.ruleSyntax=v3 - ``` - -??? info "`traefik.tcp.routers..priority`" - See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. - ```yaml - - "traefik.tcp.routers.mytcprouter.priority=42" - ``` - -??? info "`traefik.tcp.routers..service`" - - See [service](../tcp/service.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.service=myservice - ``` - -??? info "`traefik.tcp.routers..tls`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls=true - ``` - -??? info "`traefik.tcp.routers..tls.certresolver`" - - See [certResolver](../tcp/tls.md#configuration-options) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.certresolver=myresolver - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].main`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.domains[0].main=example.org - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].sans`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.domains[0].sans=test.example.org,dev.example.org - ``` - -??? info "`traefik.tcp.routers..tls.options`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.options=mysoptions - ``` - -??? info "`traefik.tcp.routers..tls.passthrough`" - - See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.passthrough=true - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.tcp.routers..rule` | See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. | ```HostSNI(`example.com`)``` | +| `traefik.tcp.routers..ruleSyntax` | configure the rule syntax to be used for parsing the rule on a per-router basis.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.tcp.routers..priority` | See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | +| `traefik.tcp.routers..service` | See [service](../tcp/service.md) for more information. | `myservice` | +| `traefik.tcp.routers..tls` | See [TLS](../tcp/tls.md) for more information. | `true` | +| `traefik.tcp.routers..tls.certresolver` | See [certResolver](../tcp/tls.md#configuration-options) for more information. | `myresolver` | +| `traefik.tcp.routers..tls.domains[n].main` | See [TLS](../tcp/tls.md) for more information. | `example.org` | +| `traefik.tcp.routers..tls.domains[n].sans` | See [TLS](../tcp/tls.md) for more information. | `test.example.org,dev.example.org` | +| `traefik.tcp.routers..tls.options` | See [TLS](../tcp/tls.md) for more information. | `mysoptions` | +| `traefik.tcp.routers..tls.passthrough` | See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. | `true` | #### TCP Services -??? info "`traefik.tcp.services..loadbalancer.server.port`" - - Registers a port of the application. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.server.port=423 - ``` +##### Configuration Options -??? info "`traefik.tcp.services..loadbalancer.server.tls`" - - Determines whether to use TLS when dialing with the backend. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.server.tls=true - ``` - -??? info "`traefik.tcp.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../tcp/serverstransport.md) for more information. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.serverstransport=foobar@file - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | +| `traefik.tcp.services..loadbalancer.server.tls` | Determines whether to use TLS when dialing with the backend. | `true` | +| `traefik.tcp.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../tcp/serverstransport.md) for more information. | `foobar@file` | #### TCP Middleware @@ -534,67 +282,28 @@ You can declare UDP Routers and/or Services using tags. #### UDP Routers -??? info "`traefik.udp.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.udp.routers.myudprouter.entrypoints=ep1,ep2 - ``` +##### Configuration Options -??? info "`traefik.udp.routers..service`" - - See [service](../udp/service.md) for more information. - - ```yaml - traefik.udp.routers.myudprouter.service=myservice - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.udp.routers..service` | See [service](../udp/service.md) for more information. | `myservice` | #### UDP Services -??? info "`traefik.udp.services..loadbalancer.server.port`" - - Registers a port of the application. - - ```yaml - traefik.udp.services.myudpservice.loadbalancer.server.port=423 - ``` +##### Configuration Options + +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | ### Specific Provider Options -#### `traefik.enable` - -```yaml -traefik.enable=true -``` - -You can tell Traefik to consider (or not) the service by setting `traefik.enable` to true or false. - -This option overrides the value of `exposedByDefault`. - -#### `traefik.consulcatalog.connect` - -```yaml -traefik.consulcatalog.connect=true -``` - -You can tell Traefik to consider (or not) the service as a Connect capable one by setting `traefik.consulcatalog.connect` to true or false. - -This option overrides the value of `connectByDefault`. - -#### `traefik.consulcatalog.canary` - -```yaml -traefik.consulcatalog.canary=true -``` - -When ConsulCatalog, in the context of a Nomad orchestrator, -is a provider (of service registration) for Traefik, -one might have the need to distinguish within Traefik between a [Canary](https://learn.hashicorp.com/tutorials/nomad/job-blue-green-and-canary-deployments#deploy-with-canaries) instance of a service, or a production one. -For example if one does not want them to be part of the same load-balancer. - -Therefore, this option, which is meant to be provided as one of the values of the `canary_tags` field in the Nomad [service stanza](https://www.nomadproject.io/docs/job-specification/service#canary_tags), -allows Traefik to identify that the associated instance is a canary one. +| Label | Description | Value | +|------|-------------|-------| +| `traefik.enable` | You can tell Traefik to consider (or not) the service by setting `traefik.enable` to true or false.
This option overrides the value of `exposedByDefault`. | `true` | +| `traefik.consulcatalog.connect` | You can tell Traefik to consider (or not) the service as a Connect capable one by setting `traefik.consulcatalog.connect` to true or false.
This option overrides the value of `connectByDefault`. | `true` | +| `traefik.consulcatalog.canary` | When ConsulCatalog, in the context of a Nomad orchestrator, is a provider (of service registration) for Traefik, one might have the need to distinguish within Traefik between a [Canary](https://learn.hashicorp.com/tutorials/nomad/job-blue-green-and-canary-deployments#deploy-with-canaries) instance of a service, or a production one.
For example if one does not want them to be part of the same load-balancer.

Therefore, this option, which is meant to be provided as one of the values of the `canary_tags` field in the Nomad [service stanza](https://www.nomadproject.io/docs/job-specification/service#canary_tags), allows Traefik to identify that the associated instance is a canary one. | `true` | #### Port Lookup diff --git a/docs/content/reference/routing-configuration/other-providers/docker.md b/docs/content/reference/routing-configuration/other-providers/docker.md index 4cc633bd1..6b9953b00 100644 --- a/docs/content/reference/routing-configuration/other-providers/docker.md +++ b/docs/content/reference/routing-configuration/other-providers/docker.md @@ -19,12 +19,12 @@ With Docker, Traefik can leverage labels attached to a container to generate rou Enabling the docker provider - ```yaml tab="File (YAML)" + ```yaml tab="Structured (YAML)" providers: docker: {} ``` - ```toml tab="File (TOML)" + ```toml tab="Structured (TOML)" [providers.docker] ``` @@ -81,7 +81,7 @@ With Docker, Traefik can leverage labels attached to a container to generate rou - traefik.http.services.admin-service.loadbalancer.server.port=9000 ``` -## Routing Configuration +## Configuration Options !!! info "Labels" @@ -145,118 +145,24 @@ For example, to change the rule, you could add the label ```traefik.http.routers !!! warning "The character `@` is not authorized in the router name ``." -??? info "`traefik.http.routers..rule`" +#### Configuration Options - See [rule](../http/routing/rules-and-priority.md) for more information. - - ```yaml - "traefik.http.routers.myrouter.rule=Host(`example.com`)" - ``` - -??? info "`traefik.http.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information. - - ```yaml - traefik.http.routers.myrouter.ruleSyntax=v3 - ``` - -??? info "`traefik.http.routers..entrypoints`" - - ```yaml - "traefik.http.routers.myrouter.entrypoints=ep1,ep2" - ``` - -??? info "`traefik.http.routers..middlewares`" - - See [middlewares overview](../http/middlewares/overview.md) for more information. - - ```yaml - "traefik.http.routers.myrouter.middlewares=auth,prefix,cb" - ``` - -??? info "`traefik.http.routers..service`" - - See [service](../http/load-balancing/service.md) for more information. - - ```yaml - "traefik.http.routers.myrouter.service=myservice" - ``` - -??? info "`traefik.http.routers..tls`" - - See [tls](../http/tls/overview.md) for more information. - - ```yaml - "traefik.http.routers.myrouter.tls=true" - ``` - -??? info "`traefik.http.routers..tls.certresolver`" - - See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. - - ```yaml - "traefik.http.routers.myrouter.tls.certresolver=myresolver" - ``` - -??? info "`traefik.http.routers..tls.domains[n].main`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - "traefik.http.routers.myrouter.tls.domains[0].main=example.org" - ``` - -??? info "`traefik.http.routers..tls.domains[n].sans`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - "traefik.http.routers.myrouter.tls.domains[0].sans=test.example.org,dev.example.org" - ``` - -??? info "`traefik.http.routers..tls.options`" - - ```yaml - "traefik.http.routers.myrouter.tls.options=foobar" - ``` - -??? info "`traefik.http.routers..observability.accesslogs`" - - The accessLogs option controls whether the router will produce access-logs. - - ```yaml - "traefik.http.routers.myrouter.observability.accesslogs=true" - ``` - -??? info "`traefik.http.routers..observability.metrics`" - - The metrics option controls whether the router will produce metrics. - - ```yaml - "traefik.http.routers.myrouter.observability.metrics=true" - ``` - -??? info "`traefik.http.routers..observability.tracing`" - - The tracing option controls whether the router will produce traces. - - ```yaml - "traefik.http.routers.myrouter.observability.tracing=true" - ``` - -??? info "`traefik.http.routers..priority`" - - See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - "traefik.http.routers.myrouter.priority=42" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.routers..rule` | See [rule](../http/routing/rules-and-priority.md#rules) for more information. | ```Host(`example.com`)``` | +| `traefik.http.routers..ruleSyntax` | See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.http.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.http.routers..middlewares` | See [middlewares overview](../http/middlewares/overview.md) for more information. | `auth,prefix,cb` | +| `traefik.http.routers..service` | See [service](../http/load-balancing/service.md) for more information. | `myservice` | +| `traefik.http.routers..tls` | See [tls](../http/tls/overview.md) for more information. | `true` | +| `traefik.http.routers..tls.certresolver` | See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. | `myresolver` | +| `traefik.http.routers..tls.domains[n].main` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `example.org` | +| `traefik.http.routers..tls.domains[n].sans` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `test.example.org,dev.example.org` | +| `traefik.http.routers..tls.options` | | `foobar` | +| `traefik.http.routers..observability.accesslogs` | The accessLogs option controls whether the router will produce access-logs. | `true` | +| `traefik.http.routers..observability.metrics` | The metrics option controls whether the router will produce metrics. | `true` | +| `traefik.http.routers..observability.tracing` | The tracing option controls whether the router will produce traces. | `true` | +| `traefik.http.routers..priority` | See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | ### Services @@ -268,182 +174,34 @@ you'd add the label `traefik.http.services..loadbalancer.pa !!! warning "The character `@` is not authorized in the service name ``." -??? info "`traefik.http.services..loadbalancer.server.port`" +#### Configuration Options - Registers a port. - Useful when the container exposes multiples ports. - - ```yaml - "traefik.http.services.myservice.loadbalancer.server.port=8080" - ``` - -??? info "`traefik.http.services..loadbalancer.server.scheme`" - - Overrides the default scheme. - - ```yaml - "traefik.http.services.myservice.loadbalancer.server.scheme=http" - ``` - -??? info "`traefik.http.services..loadbalancer.server.url`" - - Defines the service URL. - This option cannot be used in combination with `port` or `scheme` definition. - - ```yaml - traefik.http.services..loadbalancer.server.url=http://foobar:8080 - ``` - -??? info "`traefik.http.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../http/load-balancing/serverstransport.md) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.serverstransport=foobar@file" - ``` - -??? info "`traefik.http.services..loadbalancer.passhostheader`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.passhostheader=true" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.headers.`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.headers.X-Foo=foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.hostname`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.hostname=example.org" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.interval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.interval=10s" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.unhealthyinterval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.unhealthyinterval=10s" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.path`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.path=/foo" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.method`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.method=foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.status`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.status=42" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.port`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.port=42" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.scheme`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.scheme=http" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.timeout`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.timeout=10s" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.followredirects`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - "traefik.http.services.myservice.loadbalancer.healthcheck.followredirects=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.httponly`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.httponly=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.name`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.name=foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.path`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.path=/foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.secure`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.secure=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.samesite`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.samesite=none" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.maxage`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.maxage=42" - ``` - -??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.services..loadbalancer.server.port` | Registers a port.
Useful when the container exposes multiples ports. | `8080` | +| `traefik.http.services..loadbalancer.server.scheme` | Overrides the default scheme. | `http` | +| `traefik.http.services..loadbalancer.server.url` | Defines the service URL.
This option cannot be used in combination with `port` or `scheme` definition. | `http://foobar:8080` | +| `traefik.http.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../http/load-balancing/serverstransport.md) for more information. | `foobar@file` | +| `traefik.http.services..loadbalancer.passhostheader` | | `true` | +| `traefik.http.services..loadbalancer.healthcheck.headers.` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.hostname` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `example.org` | +| `traefik.http.services..loadbalancer.healthcheck.interval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10s` | +| `traefik.http.services..loadbalancer.healthcheck.unhealthyinterval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10s` | +| `traefik.http.services..loadbalancer.healthcheck.path` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `/foo` | +| `traefik.http.services..loadbalancer.healthcheck.method` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.status` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.port` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.scheme` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `http` | +| `traefik.http.services..loadbalancer.healthcheck.timeout` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10s` | +| `traefik.http.services..loadbalancer.healthcheck.followredirects` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.httponly` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.name` | | `foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.path` | | `/foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.secure` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.samesite` | | `none` | +| `traefik.http.services..loadbalancer.sticky.cookie.maxage` | | `42` | +| `traefik.http.services..loadbalancer.responseforwarding.flushinterval` | | `10` | ### Middleware @@ -497,123 +255,31 @@ You can declare TCP Routers and/or Services using labels. #### TCP Routers -??? info "`traefik.tcp.routers..entrypoints`" +##### Configuration Options - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.entrypoints=ep1,ep2" - ``` - -??? info "`traefik.tcp.routers..rule`" - - See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.rule=HostSNI(`example.com`)" - ``` - -??? info "`traefik.tcp.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - configure the rule syntax to be used for parsing the rule on a per-router basis. - - ```yaml - traefik.tcp.routers.mytcprouter.ruleSyntax=v3 - ``` - -??? info "`traefik.tcp.routers..service`" - - See [service](../tcp/service.md) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.service=myservice" - ``` - -??? info "`traefik.tcp.routers..tls`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.tls=true" - ``` - -??? info "`traefik.tcp.routers..tls.certresolver`" - - See [certResolver](../tcp/tls.md#configuration-options) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.tls.certresolver=myresolver" - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].main`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.tls.domains[0].main=example.org" - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].sans`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.tls.domains[0].sans=test.example.org,dev.example.org" - ``` - -??? info "`traefik.tcp.routers..tls.options`" - - ```yaml - "traefik.tcp.routers.mytcprouter.tls.options=mysoptions" - ``` - -??? info "`traefik.tcp.routers..tls.passthrough`" - - See [TLS](../tcp/tls.md#opt-passthrough) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.tls.passthrough=true" - ``` - -??? info "`traefik.tcp.routers..priority`" - - See [priority](../tcp/routing/rules-and-priority.md) for more information. - - ```yaml - "traefik.tcp.routers.mytcprouter.priority=42" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.tcp.routers..rule` | See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. | ```HostSNI(`example.com`)``` | +| `traefik.tcp.routers..ruleSyntax` | configure the rule syntax to be used for parsing the rule on a per-router basis.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.tcp.routers..service` | See [service](../tcp/service.md) for more information. | `myservice` | +| `traefik.tcp.routers..tls` | See [TLS](../tcp/tls.md) for more information. | `true` | +| `traefik.tcp.routers..tls.certresolver` | See [certResolver](../tcp/tls.md#configuration-options) for more information. | `myresolver` | +| `traefik.tcp.routers..tls.domains[n].main` | See [TLS](../tcp/tls.md) for more information. | `example.org` | +| `traefik.tcp.routers..tls.domains[n].sans` | See [TLS](../tcp/tls.md) for more information. | `test.example.org,dev.example.org` | +| `traefik.tcp.routers..tls.options` | | `mysoptions` | +| `traefik.tcp.routers..tls.passthrough` | See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. | `true` | +| `traefik.tcp.routers..priority` | See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | #### TCP Services -??? info "`traefik.tcp.services..loadbalancer.server.port`" +##### Configuration Options - Registers a port of the application. - - ```yaml - "traefik.tcp.services.mytcpservice.loadbalancer.server.port=423" - ``` - -??? info "`traefik.tcp.services..loadbalancer.server.tls`" - - Determines whether to use TLS when dialing with the backend. - - ```yaml - "traefik.tcp.services.mytcpservice.loadbalancer.server.tls=true" - ``` - -??? info "`traefik.tcp.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../tcp/serverstransport.md) for more information. - - ```yaml - "traefik.tcp.services.mytcpservice.loadbalancer.serverstransport=foobar@file" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | +| `traefik.tcp.services..loadbalancer.server.tls` | Determines whether to use TLS when dialing with the backend. | `true` | +| `traefik.tcp.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../tcp/serverstransport.md) for more information. | `foobar@file` | #### TCP Middleware @@ -659,76 +325,25 @@ You can declare UDP Routers and/or Services using labels. #### UDP Routers -??? info "`traefik.udp.routers..entrypoints`" +##### Configuration Options - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - "traefik.udp.routers.myudprouter.entrypoints=ep1,ep2" - ``` - -??? info "`traefik.udp.routers..service`" - - See [service](../udp/service.md) for more information. - - ```yaml - "traefik.udp.routers.myudprouter.service=myservice" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.udp.routers..service` | See [service](../udp/service.md) for more information. | `myservice` | #### UDP Services -??? info "`traefik.udp.services..loadbalancer.server.port`" +##### Configuration Options - Registers a port of the application. - - ```yaml - "traefik.udp.services.myudpservice.loadbalancer.server.port=423" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | ### Specific Provider Options -#### `traefik.enable` - -```yaml -- "traefik.enable=true" -``` - -You can tell Traefik to consider (or not) the container by setting `traefik.enable` to true or false. - -This option overrides the value of `exposedByDefault`. - -#### `traefik.docker.allownonrunning` - -```yaml -- "traefik.docker.allownonrunning=true" -``` - -By default, Traefik only considers containers in "running" state. -This option controls whether containers that are not in "running" state (e.g., stopped, paused, exited) should still be visible to Traefik for service discovery. - -When this label is set to true, Traefik will: - -- Keep the router and service configuration even when the container is not running -- Create services with empty backend server lists -- Return 503 Service Unavailable for requests to stopped containers (instead of 404 Not Found) -- Execute the full middleware chain, allowing middlewares to intercept requests - -!!! warning "Configuration Collision" - - As the `traefik.docker.allownonrunning` enables the discovery of all containers exposing this option disregarding their state, - if multiple stopped containers expose the same router but their configurations diverge, then the routers will be dropped. - -#### `traefik.docker.network` - -```yaml -- "traefik.docker.network=mynetwork" -``` - -Overrides the default docker network to use for connections to the container. - -If a container is linked to several networks, be sure to set the proper network name (you can check this with `docker inspect `), -otherwise it will randomly pick one (depending on how docker is returning them). - -!!! warning - - When deploying a stack from a compose file `stack`, the networks defined are prefixed with `stack`. +| Label | Description | Value | +|------|-------------|-------| +| `traefik.enable` | You can tell Traefik to consider (or not) the container by setting `traefik.enable` to true or false.
This option overrides the value of `exposedByDefault`. | `true` | +| `traefik.docker.allownonrunning` | By default, Traefik only considers containers in "running" state.
This option controls whether containers that are not in "running" state (e.g., stopped, paused, exited) should still be visible to Traefik for service discovery.

When this label is set to true, Traefik will:
- Keep the router and service configuration even when the container is not running
- Create services with empty backend server lists
- Return 503 Service Unavailable for requests to stopped containers (instead of 404 Not Found)
- Execute the full middleware chain, allowing middlewares to intercept requests

As the `traefik.docker.allownonrunning` enables the discovery of all containers exposing this option disregarding their state, if multiple stopped containers expose the same router but their configurations diverge, then the routers will be dropped. | `true` | +| `traefik.docker.network` | Overrides the default docker network to use for connections to the container.
If a container is linked to several networks, be sure to set the proper network name (you can check this with `docker inspect `), otherwise it will randomly pick one (depending on how docker is returning them).

When deploying a stack from a compose file `stack`, the networks defined are prefixed with `stack`. | `mynetwork` | diff --git a/docs/content/reference/routing-configuration/other-providers/ecs.md b/docs/content/reference/routing-configuration/other-providers/ecs.md index 03b4f4d45..a69e43b6b 100644 --- a/docs/content/reference/routing-configuration/other-providers/ecs.md +++ b/docs/content/reference/routing-configuration/other-providers/ecs.md @@ -13,7 +13,96 @@ With ECS, Traefik can leverage labels attached to a container to generate routin We recommend to *not* use labels to store sensitive data (certificates, credentials, etc). Instead, we recommend to store sensitive data in a safer storage (secrets, file, etc). -## Routing Configurationred +## Configuration Examples + +??? example "Configuring ECS & Deploying / Exposing one Service" + + Enabling the ECS provider + + ```yaml tab="Structured (YAML)" + providers: + ecs: {} + ``` + + ```toml tab="Structured (TOML)" + [providers.ecs] + ``` + + ```bash tab="CLI" + --providers.ecs=true + ``` + + Attaching labels to containers (in your ECS task definition) + + ```json + { + "family": "my-service", + "containerDefinitions": [ + { + "name": "my-container", + "image": "my-image:latest", + "labels": { + "traefik.http.routers.my-container.rule": "Host(`example.com`)" + } + } + ] + } + ``` + +??? example "Specify a Custom Port for the Container" + + Forward requests for `http://example.com` to `http://:12345`: + + ```json + { + "family": "my-service", + "containerDefinitions": [ + { + "name": "my-container", + "image": "my-image:latest", + "labels": { + "traefik.http.routers.my-container.rule": "Host(`example.com`)", + "traefik.http.routers.my-container.service": "my-service", + "traefik.http.services.my-service.loadbalancer.server.port": "12345" + } + } + ] + } + ``` + + !!! important "Traefik Connecting to the Wrong Port: `HTTP/502 Gateway Error`" + By default, Traefik uses the first exposed port of a container. + + Setting the label `traefik.http.services.xxx.loadbalancer.server.port` + overrides that behavior. + +??? example "Specifying more than one router and service per container" + + Forwarding requests to more than one port on a container requires referencing the service loadbalancer port definition using the service parameter on the router. + + In this example, requests are forwarded for `http://example-a.com` to `http://:8000` in addition to `http://example-b.com` forwarding to `http://:9000`: + + ```json + { + "family": "my-service", + "containerDefinitions": [ + { + "name": "my-container", + "image": "my-image:latest", + "labels": { + "traefik.http.routers.www-router.rule": "Host(`example-a.com`)", + "traefik.http.routers.www-router.service": "www-service", + "traefik.http.services.www-service.loadbalancer.server.port": "8000", + "traefik.http.routers.admin-router.rule": "Host(`example-b.com`)", + "traefik.http.routers.admin-router.service": "admin-service", + "traefik.http.services.admin-service.loadbalancer.server.port": "9000" + } + } + ] + } + ``` + +## Configuration Options !!! info "labels" @@ -37,120 +126,24 @@ For example, to change the rule, you could add the label ```traefik.http.routers !!! warning "The character `@` is not authorized in the router name ``." -??? info "`traefik.http.routers..rule`" - - See [rule](../http/routing/rules-and-priority.md#rules) for more information. - - ```yaml - traefik.http.routers.myrouter.rule=Host(`example.com`) - ``` +#### Configuration Options -??? info "`traefik.http.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information. - - ```yaml - traefik.http.routers.myrouter.ruleSyntax=v3 - ``` - -??? info "`traefik.http.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.http.routers.myrouter.entrypoints=web,websecure - ``` - -??? info "`traefik.http.routers..middlewares`" - - See [middlewares overview](../http/middlewares/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.middlewares=auth,prefix,cb - ``` - -??? info "`traefik.http.routers..service`" - - See [service](../http/load-balancing/service.md) for more information. - - ```yaml - traefik.http.routers.myrouter.service=myservice - ``` - -??? info "`traefik.http.routers..tls`" - - See [tls](../http/tls/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.tls=true - ``` - -??? info "`traefik.http.routers..tls.certresolver`" - - See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.certresolver=myresolver - ``` - -??? info "`traefik.http.routers..tls.domains[n].main`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.domains[0].main=example.org - ``` - -??? info "`traefik.http.routers..tls.domains[n].sans`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.domains[0].sans=test.example.org,dev.example.org - ``` - -??? info "`traefik.http.routers..tls.options`" - - ```yaml - traefik.http.routers.myrouter.tls.options=foobar - ``` - -??? info "`traefik.http.routers..observability.accesslogs`" - - The accessLogs option controls whether the router will produce access-logs. - - ```yaml - "traefik.http.routers.myrouter.observability.accesslogs=true" - ``` - -??? info "`traefik.http.routers..observability.metrics`" - - The metrics option controls whether the router will produce metrics. - - ```yaml - "traefik.http.routers.myrouter.observability.metrics=true" - ``` - -??? info "`traefik.http.routers..observability.tracing`" - - The tracing option controls whether the router will produce traces. - - ```yaml - "traefik.http.routers.myrouter.observability.tracing=true" - ``` - -??? info "`traefik.http.routers..priority`" - - See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - traefik.http.routers.myrouter.priority=42 - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.routers..rule` | See [rule](../http/routing/rules-and-priority.md#rules) for more information. | ```Host(`example.com`)``` | +| `traefik.http.routers..ruleSyntax` | See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.http.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `web,websecure` | +| `traefik.http.routers..middlewares` | See [middlewares overview](../http/middlewares/overview.md) for more information. | `auth,prefix,cb` | +| `traefik.http.routers..service` | See [service](../http/load-balancing/service.md) for more information. | `myservice` | +| `traefik.http.routers..tls` | See [tls](../http/tls/overview.md) for more information. | `true` | +| `traefik.http.routers..tls.certresolver` | See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. | `myresolver` | +| `traefik.http.routers..tls.domains[n].main` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `example.org` | +| `traefik.http.routers..tls.domains[n].sans` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `test.example.org,dev.example.org` | +| `traefik.http.routers..tls.options` | | `foobar` | +| `traefik.http.routers..observability.accesslogs` | The accessLogs option controls whether the router will produce access-logs. | `true` | +| `traefik.http.routers..observability.metrics` | The metrics option controls whether the router will produce metrics. | `true` | +| `traefik.http.routers..observability.tracing` | The tracing option controls whether the router will produce traces. | `true` | +| `traefik.http.routers..priority` | See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | ### Services @@ -162,175 +155,33 @@ you'd add the label `traefik.http.services.{name-of-your-choice}.loadbalancer.pa !!! warning "The character `@` is not authorized in the service name ``." -??? info "`traefik.http.services..loadbalancer.server.port`" - - Registers a port. - Useful when the service exposes multiples ports. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.port=8080 - ``` +#### Configuration Options -??? info "`traefik.http.services..loadbalancer.server.scheme`" - - Overrides the default scheme. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.scheme=http - ``` - -??? info "`traefik.http.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../http/load-balancing/serverstransport.md) for more information. - - ```yaml - traefik.http.services..loadbalancer.serverstransport=foobar@file - ``` - -??? info "`traefik.http.services..loadbalancer.passhostheader`" - - ```yaml - traefik.http.services.myservice.loadbalancer.passhostheader=true - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.headers.`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.headers.X-Foo=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.hostname`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.hostname=example.org - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.interval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.interval=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.unhealthyinterval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.unhealthyinterval=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.path`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.path=/foo - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.method`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.method=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.status`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.status=42 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.port`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.port=42 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.scheme`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.scheme=http - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.timeout`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.timeout=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.followredirects`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.followredirects=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.httponly`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.httponly=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.name`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.name=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.path`" - - ```yaml - "traefik.http.services.myservice.loadbalancer.sticky.cookie.path=/foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.secure`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.secure=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.samesite`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.samesite=none - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.maxage`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.maxage=42 - ``` - -??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - `FlushInterval` specifies the flush interval to flush to the client while copying the response body. - - ```yaml - traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10 - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.services..loadbalancer.server.port` | Registers a port.
Useful when the service exposes multiples ports. | `8080` | +| `traefik.http.services..loadbalancer.server.scheme` | Overrides the default scheme. | `http` | +| `traefik.http.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../http/load-balancing/serverstransport.md) for more information. | `foobar@file` | +| `traefik.http.services..loadbalancer.passhostheader` | | `true` | +| `traefik.http.services..loadbalancer.healthcheck.headers.` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.hostname` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `example.org` | +| `traefik.http.services..loadbalancer.healthcheck.interval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.unhealthyinterval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.path` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `/foo` | +| `traefik.http.services..loadbalancer.healthcheck.method` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.status` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.port` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.scheme` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `http` | +| `traefik.http.services..loadbalancer.healthcheck.timeout` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.followredirects` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.httponly` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.name` | | `foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.path` | | `/foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.secure` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.samesite` | | `none` | +| `traefik.http.services..loadbalancer.sticky.cookie.maxage` | | `42` | +| `traefik.http.services..loadbalancer.responseforwarding.flushinterval` | `FlushInterval` specifies the flush interval to flush to the client while copying the response body. | `10` | ### Middleware @@ -375,133 +226,32 @@ You can declare TCP Routers and/or Services using labels. #### TCP Routers -??? info "`traefik.tcp.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.entrypoints=ep1,ep2 - ``` +##### Configuration Options -??? info "`traefik.tcp.routers..rule`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.rule=HostSNI(`example.com`) - ``` - -??? info "`traefik.tcp.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - configure the rule syntax to be used for parsing the rule on a per-router basis. - - ```yaml - traefik.tcp.routers.mytcprouter.ruleSyntax=v3 - ``` - -??? info "`traefik.tcp.routers..service`" - - See [service](../tcp/service.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.service=myservice - ``` - -??? info "`traefik.tcp.routers..tls`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls=true - ``` - -??? info "`traefik.tcp.routers..tls.certresolver`" - - See [certResolver](../tcp/tls.md#configuration-options) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.certresolver=myresolver - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].main`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.domains[0].main=example.org - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].sans`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.domains[0].sans=test.example.org,dev.example.org - ``` - -??? info "`traefik.tcp.routers..tls.options`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.options=mysoptions - ``` - -??? info "`traefik.tcp.routers..tls.passthrough`" - - See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.passthrough=true - ``` - -??? info "`traefik.tcp.routers..priority`" - - See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.priority=42 - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.tcp.routers..rule` | See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. | ```HostSNI(`example.com`)``` | +| `traefik.tcp.routers..ruleSyntax` | configure the rule syntax to be used for parsing the rule on a per-router basis.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.tcp.routers..service` | See [service](../tcp/service.md) for more information. | `myservice` | +| `traefik.tcp.routers..tls` | See [TLS](../tcp/tls.md) for more information. | `true` | +| `traefik.tcp.routers..tls.certresolver` | See [certResolver](../tcp/tls.md#configuration-options) for more information. | `myresolver` | +| `traefik.tcp.routers..tls.domains[n].main` | See [TLS](../tcp/tls.md) for more information. | `example.org` | +| `traefik.tcp.routers..tls.domains[n].sans` | See [TLS](../tcp/tls.md) for more information. | `test.example.org,dev.example.org` | +| `traefik.tcp.routers..tls.options` | See [TLS](../tcp/tls.md) for more information. | `mysoptions` | +| `traefik.tcp.routers..tls.passthrough` | See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. | `true` | +| `traefik.tcp.routers..priority` | See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | #### TCP Services -??? info "`traefik.tcp.services..loadbalancer.server.port`" - - Registers a port of the application. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.server.port=423 - ``` +##### Configuration Options -??? info "`traefik.tcp.services..loadbalancer.server.tls`" - - Determines whether to use TLS when dialing with the backend. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.server.tls=true - ``` - -??? info "`traefik.http.services..loadbalancer.server.weight`" - - Overrides the default weight. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.weight=42 - ``` - -??? info "`traefik.tcp.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../tcp/serverstransport.md) for more information. - - ```yaml - traefik.tcp.services..loadbalancer.serverstransport=foobar@file - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | +| `traefik.tcp.services..loadbalancer.server.tls` | Determines whether to use TLS when dialing with the backend. | `true` | +| `traefik.tcp.services..loadbalancer.server.weight` | Overrides the default weight. | `42` | +| `traefik.tcp.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../tcp/serverstransport.md) for more information. | `foobar@file` | ### UDP @@ -543,40 +293,25 @@ More information about available middlewares in the dedicated [middlewares secti #### UDP Routers -??? info "`traefik.udp.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.udp.routers.myudprouter.entrypoints=ep1,ep2 - ``` +##### Configuration Options -??? info "`traefik.udp.routers..service`" - - See [service](../udp/service.md) for more information. - - ```yaml - traefik.udp.routers.myudprouter.service=myservice - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.udp.routers..service` | See [service](../udp/service.md) for more information. | `myservice` | #### UDP Services -??? info "`traefik.udp.services..loadbalancer.server.port`" - - Registers a port of the application. - - ```yaml - traefik.udp.services.myudpservice.loadbalancer.server.port=423 - ``` +##### Configuration Options + +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | ### Specific Provider Options -#### `traefik.enable` +#### Configuration Options -```yaml -traefik.enable=true -``` - -You can tell Traefik to consider (or not) the ECS service by setting `traefik.enable` to true or false. - -This option overrides the value of `exposedByDefault`. +| Label | Description | Value | +|------|-------------|-------| +| `traefik.enable` | You can tell Traefik to consider (or not) the ECS service by setting `traefik.enable` to true or false.
This option overrides the value of `exposedByDefault`. | `true` | diff --git a/docs/content/reference/routing-configuration/other-providers/kv.md b/docs/content/reference/routing-configuration/other-providers/kv.md index 8f11d50ba..6707ac2ba 100644 --- a/docs/content/reference/routing-configuration/other-providers/kv.md +++ b/docs/content/reference/routing-configuration/other-providers/kv.md @@ -5,6 +5,62 @@ description: "Read the technical documentation to learn the Traefik Routing Conf # Traefik & KV Stores +## Configuration Examples + +??? example "Configuring KV Store & Deploying / Exposing one Service" + + Enabling a KV store provider (example: Consul) + + ```yaml tab="Structured (YAML)" + providers: + consul: + endpoints: + - "127.0.0.1:8500" + ``` + + ```toml tab="Structured (TOML)" + [providers.consul] + endpoints = ["127.0.0.1:8500"] + ``` + + ```bash tab="CLI" + --providers.consul.endpoints=127.0.0.1:8500 + ``` + + Setting keys in the KV store (example: Consul) + + ```bash + consul kv put traefik/http/routers/my-router/rule "Host(`example.com`)" + consul kv put traefik/http/routers/my-router/service "my-service" + consul kv put traefik/http/services/my-service/loadbalancer/servers/0/url "http://127.0.0.1:8080" + ``` + +??? example "Specify a Custom Port for the Service" + + Forward requests for `http://example.com` to `http://127.0.0.1:12345`: + + ```bash + consul kv put traefik/http/routers/my-router/rule "Host(`example.com`)" + consul kv put traefik/http/routers/my-router/service "my-service" + consul kv put traefik/http/services/my-service/loadbalancer/servers/0/url "http://127.0.0.1:12345" + ``` + +??? example "Specifying more than one router and service" + + Forwarding requests to more than one service requires defining multiple routers and services. + + In this example, requests are forwarded for `http://example-a.com` to `http://127.0.0.1:8000` in addition to `http://example-b.com` forwarding to `http://127.0.0.1:9000`: + + ```bash + consul kv put traefik/http/routers/www-router/rule "Host(`example-a.com`)" + consul kv put traefik/http/routers/www-router/service "www-service" + consul kv put traefik/http/services/www-service/loadbalancer/servers/0/url "http://127.0.0.1:8000" + + consul kv put traefik/http/routers/admin-router/rule "Host(`example-b.com`)" + consul kv put traefik/http/routers/admin-router/service "admin-service" + consul kv put traefik/http/services/admin-service/loadbalancer/servers/0/url "http://127.0.0.1:9000" + ``` + ## Configuration Options !!! info "Keys" @@ -93,15 +149,6 @@ description: "Read the technical documentation to learn the Traefik Routing Conf If you declare multiple middleware with the same name but with different parameters, the middleware fails to be declared. -##### Configuration Example - -```bash -# Declaring a middleware -traefik/http/middlewares/myAddPrefix/addPrefix/prefix=/foobar -# Referencing a middleware -traefik/http/routers//middlewares/0=myAddPrefix -``` - #### ServerTransport ##### Configuration Options @@ -110,17 +157,6 @@ traefik/http/routers//middlewares/0=myAddPrefix |-----------------------------------------------------------------|-----------------------------------------------------------------|-----------------------------------------| | `traefik/http/serversTransports//st_option` | With `st_option` the ServerTransport option to set (ex `maxIdleConnsPerHost`).
More information about available options in the dedicated [ServerTransport section](../http/load-balancing/serverstransport.md). | ServerTransport Options | -##### Configuration Example - -```bash -# Declaring a ServerTransport -traefik/http/serversTransports/myServerTransport/maxIdleConnsPerHost=-1 -traefik/http/serversTransports/myServerTransport/certificates/0/certFile=mypath/cert.pem -traefik/http/serversTransports/myServerTransport/certificates/0/keyFile=mypath/key.pem -# Referencing a middleware -traefik/http/services/myService/serversTransports/0=myServerTransport -``` - ### TCP You can declare TCP Routers and/or Services using KV. @@ -170,15 +206,6 @@ More information about available middlewares in the dedicated [middlewares secti If you declare multiple middleware with the same name but with different parameters, the middleware fails to be declared. -##### Configuration Example - -```bash -# Declaring a middleware -traefik/tcp/middlewares/test-inflightconn/amount=10 -# Referencing a middleware -traefik/tcp/routers//middlewares/0=test-inflightconn -``` - #### ServerTransport ##### Configuration Options @@ -187,15 +214,6 @@ traefik/tcp/routers//middlewares/0=test-inflightconn |-----------------------------------------------------------------|-----------------------------------------------------------------|-----------------------------------------| | `traefik/tcp/serversTransports//st_option` | With `st_option` the ServerTransport option to set (ex `maxIdleConnsPerHost`).
More information about available options in the dedicated [ServerTransport section](../tcp/serverstransport.md). | ServerTransport Options | -##### Configuration Example - -```bash -# Declaring a ServerTransport -traefik/tcp/serversTransports/myServerTransport/maxIdleConnsPerHost=-1 -# Referencing a middleware -traefik/tcp/services/myService/serversTransports/0=myServerTransport -``` - ### UDP You can declare UDP Routers and/or Services using KV. diff --git a/docs/content/reference/routing-configuration/other-providers/nomad.md b/docs/content/reference/routing-configuration/other-providers/nomad.md index 18c962ed7..d4bf63b9e 100644 --- a/docs/content/reference/routing-configuration/other-providers/nomad.md +++ b/docs/content/reference/routing-configuration/other-providers/nomad.md @@ -13,7 +13,108 @@ With Nomad, Traefik can leverage tags attached to a service to generate routing We recommend to *not* use tags to store sensitive data (certificates, credentials, etc). Instead, we recommend to store sensitive data in a safer storage (secrets, file, etc). -## Routing Configuration +## Configuration Examples + +??? example "Configuring Nomad & Deploying / Exposing one Service" + + Enabling the nomad provider + + ```yaml tab="Structured (YAML)" + providers: + nomad: {} + ``` + + ```toml tab="Structured (TOML)" + [providers.nomad] + ``` + + ```bash tab="CLI" + --providers.nomad=true + ``` + + Attaching tags to services (in your Nomad job file) + + ```hcl + job "my-service" { + datacenters = ["dc1"] + + group "web" { + task "app" { + driver = "docker" + + service { + name = "my-service" + tags = [ + "traefik.http.routers.my-service.rule=Host(`example.com`)", + ] + } + } + } + } + ``` + +??? example "Specify a Custom Port for the Container" + + Forward requests for `http://example.com` to `http://:12345`: + + ```hcl + job "my-service" { + datacenters = ["dc1"] + + group "web" { + task "app" { + driver = "docker" + + service { + name = "my-service" + tags = [ + "traefik.http.routers.my-service.rule=Host(`example.com`)", + "traefik.http.routers.my-service.service=my-service", + "traefik.http.services.my-service.loadbalancer.server.port=12345", + ] + } + } + } + } + ``` + + !!! important "Traefik Connecting to the Wrong Port: `HTTP/502 Gateway Error`" + By default, Traefik uses the first exposed port of a container. + + Setting the tag `traefik.http.services.xxx.loadbalancer.server.port` + overrides that behavior. + +??? example "Specifying more than one router and service per container" + + Forwarding requests to more than one port on a container requires referencing the service loadbalancer port definition using the service parameter on the router. + + In this example, requests are forwarded for `http://example-a.com` to `http://:8000` in addition to `http://example-b.com` forwarding to `http://:9000`: + + ```hcl + job "my-service" { + datacenters = ["dc1"] + + group "web" { + task "app" { + driver = "docker" + + service { + name = "my-service" + tags = [ + "traefik.http.routers.www-router.rule=Host(`example-a.com`)", + "traefik.http.routers.www-router.service=www-service", + "traefik.http.services.www-service.loadbalancer.server.port=8000", + "traefik.http.routers.admin-router.rule=Host(`example-b.com`)", + "traefik.http.routers.admin-router.service=admin-service", + "traefik.http.services.admin-service.loadbalancer.server.port=9000", + ] + } + } + } + } + ``` + +## Configuration Options !!! info "Tags" @@ -35,120 +136,24 @@ To update the configuration of the Router automatically attached to the service, For example, to change the rule, you could add the tag ```traefik.http.routers.my-service.rule=Host(`example.com`)```. -??? info "`traefik.http.routers..rule`" +#### Configuration Options - See [rule](../http/routing/rules-and-priority.md) for more information. - - ```yaml - traefik.http.routers.myrouter.rule=Host(`example.com`) - ``` - -??? info "`traefik.http.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information. - - ```yaml - traefik.http.routers.myrouter.ruleSyntax=v3 - ``` - -??? info "`traefik.http.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.http.routers.myrouter.entrypoints=web,websecure - ``` - -??? info "`traefik.http.routers..middlewares`" - - See [middlewares overview](../http/middlewares/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.middlewares=auth,prefix,cb - ``` - -??? info "`traefik.http.routers..service`" - - See [service](../http/load-balancing/service.md) for more information. - - ```yaml - traefik.http.routers.myrouter.service=myservice - ``` - -??? info "`traefik.http.routers..tls`" - - See [tls](../http/tls/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.tls=true - ``` - -??? info "`traefik.http.routers..tls.certresolver`" - - See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.certresolver=myresolver - ``` - -??? info "`traefik.http.routers..tls.domains[n].main`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.domains[0].main=example.org - ``` - -??? info "`traefik.http.routers..tls.domains[n].sans`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - traefik.http.routers.myrouter.tls.domains[0].sans=test.example.org,dev.example.org - ``` - -??? info "`traefik.http.routers..tls.options`" - - ```yaml - traefik.http.routers.myrouter.tls.options=foobar - ``` - -??? info "`traefik.http.routers..priority`" - - See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - traefik.http.routers.myrouter.priority=42 - ``` - -??? info "`traefik.http.routers..observability.accesslogs`" - - The accessLogs option controls whether the router will produce access-logs. - - ```yaml - "traefik.http.routers.myrouter.observability.accesslogs=true" - ``` - -??? info "`traefik.http.routers..observability.metrics`" - - The metrics option controls whether the router will produce metrics. - - ```yaml - "traefik.http.routers.myrouter.observability.metrics=true" - ``` - -??? info "`traefik.http.routers..observability.tracing`" - - The tracing option controls whether the router will produce traces. - - ```yaml - "traefik.http.routers.myrouter.observability.tracing=true" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.routers..rule` | See [rule](../http/routing/rules-and-priority.md#rules) for more information. | ```Host(`example.com`)``` | +| `traefik.http.routers..ruleSyntax` | See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.http.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `web,websecure` | +| `traefik.http.routers..middlewares` | See [middlewares overview](../http/middlewares/overview.md) for more information. | `auth,prefix,cb` | +| `traefik.http.routers..service` | See [service](../http/load-balancing/service.md) for more information. | `myservice` | +| `traefik.http.routers..tls` | See [tls](../http/tls/overview.md) for more information. | `true` | +| `traefik.http.routers..tls.certresolver` | See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. | `myresolver` | +| `traefik.http.routers..tls.domains[n].main` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `example.org` | +| `traefik.http.routers..tls.domains[n].sans` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `test.example.org,dev.example.org` | +| `traefik.http.routers..tls.options` | | `foobar` | +| `traefik.http.routers..priority` | See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | +| `traefik.http.routers..observability.accesslogs` | The accessLogs option controls whether the router will produce access-logs. | `true` | +| `traefik.http.routers..observability.metrics` | The metrics option controls whether the router will produce metrics. | `true` | +| `traefik.http.routers..observability.tracing` | The tracing option controls whether the router will produce traces. | `true` | ### Services @@ -158,173 +163,33 @@ add tags starting with `traefik.http.services.{name-of-your-choice}.`, followed For example, to change the `passHostHeader` behavior, you'd add the tag `traefik.http.services.{name-of-your-choice}.loadbalancer.passhostheader=false`. -??? info "`traefik.http.services..loadbalancer.server.port`" +#### Configuration Options - Registers a port. - Useful when the service exposes multiples ports. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.port=8080 - ``` - -??? info "`traefik.http.services..loadbalancer.server.scheme`" - - Overrides the default scheme. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.scheme=http - ``` - -??? info "`traefik.http.services..loadbalancer.server.weight`" - - Overrides the default weight. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.weight=42 - ``` - -??? info "`traefik.http.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../http/load-balancing/serverstransport.md) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.serverstransport=foobar@file - ``` - -??? info "`traefik.http.services..loadbalancer.passhostheader`" - - ```yaml - traefik.http.services.myservice.loadbalancer.passhostheader=true - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.headers.`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.headers.X-Foo=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.hostname`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.hostname=example.org - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.interval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.interval=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.unhealthyinterval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.unhealthyinterval=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.path`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.path=/foo - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.status`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.status=42 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.port`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.port=42 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.scheme`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.scheme=http - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.timeout`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.timeout=10 - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.followredirects`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - traefik.http.services.myservice.loadbalancer.healthcheck.followredirects=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.httponly`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.httponly=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.name`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.name=foobar - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.path`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie.path=/foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.secure`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.secure=true - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.samesite`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.samesite=none - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.maxage`" - - ```yaml - traefik.http.services.myservice.loadbalancer.sticky.cookie.maxage=42 - ``` - -??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - ```yaml - traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10 - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.services..loadbalancer.server.port` | Registers a port.
Useful when the service exposes multiples ports. | `8080` | +| `traefik.http.services..loadbalancer.server.scheme` | Overrides the default scheme. | `http` | +| `traefik.http.services..loadbalancer.server.weight` | Overrides the default weight. | `42` | +| `traefik.http.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../http/load-balancing/serverstransport.md) for more information. | `foobar@file` | +| `traefik.http.services..loadbalancer.passhostheader` | | `true` | +| `traefik.http.services..loadbalancer.healthcheck.headers.` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.hostname` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `example.org` | +| `traefik.http.services..loadbalancer.healthcheck.interval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.unhealthyinterval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.path` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `/foo` | +| `traefik.http.services..loadbalancer.healthcheck.status` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.port` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.scheme` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `http` | +| `traefik.http.services..loadbalancer.healthcheck.timeout` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10` | +| `traefik.http.services..loadbalancer.healthcheck.followredirects` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.httponly` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.name` | | `foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.path` | | `/foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.secure` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.samesite` | | `none` | +| `traefik.http.services..loadbalancer.sticky.cookie.maxage` | | `42` | +| `traefik.http.services..loadbalancer.responseforwarding.flushinterval` | | `10` | ### Middleware @@ -367,125 +232,31 @@ You can declare TCP Routers and/or Services using tags. #### TCP Routers -??? info "`traefik.tcp.routers..entrypoints`" +##### Configuration Options - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.entrypoints=ep1,ep2 - ``` - -??? info "`traefik.tcp.routers..rule`" - - See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.rule=HostSNI(`example.com`) - ``` - -??? info "`traefik.tcp.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - configure the rule syntax to be used for parsing the rule on a per-router basis. - - ```yaml - traefik.tcp.routers.mytcprouter.ruleSyntax=v3 - ``` - -??? info "`traefik.tcp.routers..priority`" - - See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - traefik.tcp.routers.myrouter.priority=42 - ``` - -??? info "`traefik.tcp.routers..service`" - - See [service](../tcp/service.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.service=myservice - ``` - -??? info "`traefik.tcp.routers..tls`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls=true - ``` - -??? info "`traefik.tcp.routers..tls.certresolver`" - - See [certResolver](../tcp/tls.md#configuration-options) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.certresolver=myresolver - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].main`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.domains[0].main=example.org - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].sans`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.domains[0].sans=test.example.org,dev.example.org - ``` - -??? info "`traefik.tcp.routers..tls.options`" - - See [TLS](../tcp/tls.md#configuration-options) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.options=myoptions - ``` - -??? info "`traefik.tcp.routers..tls.passthrough`" - - See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. - - ```yaml - traefik.tcp.routers.mytcprouter.tls.passthrough=true - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.tcp.routers..rule` | See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. | ```HostSNI(`example.com`)``` | +| `traefik.tcp.routers..ruleSyntax` | configure the rule syntax to be used for parsing the rule on a per-router basis.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.tcp.routers..priority` | See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | +| `traefik.tcp.routers..service` | See [service](../tcp/service.md) for more information. | `myservice` | +| `traefik.tcp.routers..tls` | See [TLS](../tcp/tls.md) for more information. | `true` | +| `traefik.tcp.routers..tls.certresolver` | See [certResolver](../tcp/tls.md#configuration-options) for more information. | `myresolver` | +| `traefik.tcp.routers..tls.domains[n].main` | See [TLS](../tcp/tls.md) for more information. | `example.org` | +| `traefik.tcp.routers..tls.domains[n].sans` | See [TLS](../tcp/tls.md) for more information. | `test.example.org,dev.example.org` | +| `traefik.tcp.routers..tls.options` | See [TLS](../tcp/tls.md#configuration-options) for more information. | `myoptions` | +| `traefik.tcp.routers..tls.passthrough` | See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. | `true` | #### TCP Services -??? info "`traefik.tcp.services..loadbalancer.server.port`" +##### Configuration Options - Registers a port of the application. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.server.port=423 - ``` - -??? info "`traefik.tcp.services..loadbalancer.server.tls`" - - Determines whether to use TLS when dialing with the backend. - - ```yaml - traefik.tcp.services.mytcpservice.loadbalancer.server.tls=true - ``` - -??? info "`traefik.tcp.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../tcp/serverstransport.md) for more information. - - ```yaml - traefik.tcp.services.myservice.loadbalancer.serverstransport=foobar@file - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | +| `traefik.tcp.services..loadbalancer.server.tls` | Determines whether to use TLS when dialing with the backend. | `true` | +| `traefik.tcp.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../tcp/serverstransport.md) for more information. | `foobar@file` | #### TCP Middleware @@ -527,56 +298,27 @@ You can declare UDP Routers and/or Services using tags. #### UDP Routers -??? info "`traefik.udp.routers..entrypoints`" +##### Configuration Options - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - traefik.udp.routers.myudprouter.entrypoints=ep1,ep2 - ``` - -??? info "`traefik.udp.routers..service`" - - See [service](../udp/service.md) for more information. - - ```yaml - traefik.udp.routers.myudprouter.service=myservice - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.udp.routers..service` | See [service](../udp/service.md) for more information. | `myservice` | #### UDP Services -??? info "`traefik.udp.services..loadbalancer.server.port`" +##### Configuration Options - Registers a port of the application. - - ```yaml - traefik.udp.services.myudpservice.loadbalancer.server.port=423 - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | ### Specific Provider Options -#### `traefik.enable` - -```yaml -traefik.enable=true -``` - -You can tell Traefik to consider (or not) the service by setting `traefik.enable` to true or false. - -This option overrides the value of `exposedByDefault`. - -#### `traefik.nomad.canary` - -```yaml -traefik.nomad.canary=true -``` - -When Nomad orchestrator is a provider (of service registration) for Traefik, -one might have the need to distinguish within Traefik between a [Canary](https://learn.hashicorp.com/tutorials/nomad/job-blue-green-and-canary-deployments#deploy-with-canaries) instance of a service, or a production one. -For example if one does not want them to be part of the same load-balancer. - -Therefore, this option, which is meant to be provided as one of the values of the `canary_tags` field in the Nomad [service stanza](https://www.nomadproject.io/docs/job-specification/service#canary_tags), -allows Traefik to identify that the associated instance is a canary one. +| Label | Description | Value | +|------|-------------|-------| +| `traefik.enable` | You can tell Traefik to consider (or not) the service by setting `traefik.enable` to true or false.
This option overrides the value of `exposedByDefault`. | `true` | +| `traefik.nomad.canary` | When Nomad orchestrator is a provider (of service registration) for Traefik, one might have the need to distinguish within Traefik between a [Canary](https://learn.hashicorp.com/tutorials/nomad/job-blue-green-and-canary-deployments#deploy-with-canaries) instance of a service, or a production one.
For example if one does not want them to be part of the same load-balancer.

Therefore, this option, which is meant to be provided as one of the values of the `canary_tags` field in the Nomad [service stanza](https://www.nomadproject.io/docs/job-specification/service#canary_tags), allows Traefik to identify that the associated instance is a canary one. | `true` | #### Port Lookup diff --git a/docs/content/reference/routing-configuration/other-providers/swarm.md b/docs/content/reference/routing-configuration/other-providers/swarm.md index 2885b1e48..a49e6c861 100644 --- a/docs/content/reference/routing-configuration/other-providers/swarm.md +++ b/docs/content/reference/routing-configuration/other-providers/swarm.md @@ -19,7 +19,7 @@ With Docker Swarm, Traefik can leverage labels attached to a service to generate Enabling the docker provider (Swarm Mode) - ```yaml tab="File (YAML)" + ```yaml tab="Structured (YAML)" providers: swarm: # swarm classic (1.12-) @@ -28,7 +28,7 @@ With Docker Swarm, Traefik can leverage labels attached to a service to generate endpoint: "tcp://127.0.0.1:2377" ``` - ```toml tab="File (TOML)" + ```toml tab="Structured (TOML)" [providers.swarm] # swarm classic (1.12-) # endpoint = "tcp://127.0.0.1:2375" @@ -104,7 +104,7 @@ With Docker Swarm, Traefik can leverage labels attached to a service to generate - traefik.http.services.admin-service.loadbalancer.server.port=9000 ``` -## Routing Configuration +## Configuration Options !!! info "Labels" @@ -156,120 +156,24 @@ For example, to change the rule, you could add the label ```traefik.http.routers !!! warning "The character `@` is not authorized in the router name ``." -??? info "`traefik.http.routers..rule`" +#### Configuration Options - See [rule](../http/routing/rules-and-priority.md) for more information. - - ```yaml - - "traefik.http.routers.myrouter.rule=Host(`example.com`)" - ``` - -??? info "`traefik.http.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information. - - ```yaml - traefik.http.routers.myrouter.ruleSyntax=v3 - ``` - -??? info "`traefik.http.routers..entrypoints`" - - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - - "traefik.http.routers.myrouter.entrypoints=ep1,ep2" - ``` - -??? info "`traefik.http.routers..middlewares`" - - See [middlewares overview](../http/middlewares/overview.md) for more information. - - ```yaml - - "traefik.http.routers.myrouter.middlewares=auth,prefix,cb" - ``` - -??? info "`traefik.http.routers..service`" - - See [service](../http/load-balancing/service.md) for more information. - - ```yaml - - "traefik.http.routers.myrouter.service=myservice" - ``` - -??? info "`traefik.http.routers..tls`" - - See [tls](../http/tls/overview.md) for more information. - - ```yaml - - "traefik.http.routers.myrouter.tls=true" - ``` - -??? info "`traefik.http.routers..tls.certresolver`" - - See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. - - ```yaml - - "traefik.http.routers.myrouter.tls.certresolver=myresolver" - ``` - -??? info "`traefik.http.routers..tls.domains[n].main`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - - "traefik.http.routers.myrouter.tls.domains[0].main=example.org" - ``` - -??? info "`traefik.http.routers..tls.domains[n].sans`" - - See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. - - ```yaml - - "traefik.http.routers.myrouter.tls.domains[0].sans=test.example.org,dev.example.org" - ``` - -??? info "`traefik.http.routers..tls.options`" - - ```yaml - - "traefik.http.routers.myrouter.tls.options=foobar" - ``` - -??? info "`traefik.http.routers..observability.accesslogs`" - - The accessLogs option controls whether the router will produce access-logs. - - ```yaml - "traefik.http.routers.myrouter.observability.accesslogs=true" - ``` - -??? info "`traefik.http.routers..observability.metrics`" - - The metrics option controls whether the router will produce metrics. - - ```yaml - "traefik.http.routers.myrouter.observability.metrics=true" - ``` - -??? info "`traefik.http.routers..observability.tracing`" - - The tracing option controls whether the router will produce traces. - - ```yaml - "traefik.http.routers.myrouter.observability.tracing=true" - ``` - -??? info "`traefik.http.routers..priority`" - - See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. - - ```yaml - - "traefik.http.routers.myrouter.priority=42" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.routers..rule` | See [rule](../http/routing/rules-and-priority.md#rules) for more information. | ```Host(`example.com`)``` | +| `traefik.http.routers..ruleSyntax` | See [ruleSyntax](../http/routing/rules-and-priority.md#rulesyntax) for more information.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.http.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.http.routers..middlewares` | See [middlewares overview](../http/middlewares/overview.md) for more information. | `auth,prefix,cb` | +| `traefik.http.routers..service` | See [service](../http/load-balancing/service.md) for more information. | `myservice` | +| `traefik.http.routers..tls` | See [tls](../http/tls/overview.md) for more information. | `true` | +| `traefik.http.routers..tls.certresolver` | See [certResolver](../../install-configuration/tls/certificate-resolvers/overview.md) for more information. | `myresolver` | +| `traefik.http.routers..tls.domains[n].main` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `example.org` | +| `traefik.http.routers..tls.domains[n].sans` | See [domains](../../install-configuration/tls/certificate-resolvers/acme.md#domain-definition) for more information. | `test.example.org,dev.example.org` | +| `traefik.http.routers..tls.options` | | `foobar` | +| `traefik.http.routers..observability.accesslogs` | The accessLogs option controls whether the router will produce access-logs. | `true` | +| `traefik.http.routers..observability.metrics` | The metrics option controls whether the router will produce metrics. | `true` | +| `traefik.http.routers..observability.tracing` | The tracing option controls whether the router will produce traces. | `true` | +| `traefik.http.routers..priority` | See [priority](../http/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | ### Services @@ -281,189 +185,34 @@ you'd add the label `traefik.http.services..loadbalancer.pa !!! warning "The character `@` is not authorized in the service name ``." -??? info "`traefik.http.services..loadbalancer.server.port`" +#### Configuration Options - Registers a port. - Useful when the container exposes multiples ports. - - Mandatory for Docker Swarm (see the section ["Port Detection with Docker Swarm"](../../install-configuration/providers/swarm.md#port-detection)). - {: #port } - - ```yaml - - "traefik.http.services.myservice.loadbalancer.server.port=8080" - ``` - -??? info "`traefik.http.services..loadbalancer.server.scheme`" - - Overrides the default scheme. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.server.scheme=http" - ``` - -??? info "`traefik.http.services..loadbalancer.server.url`" - - Defines the service URL. - This option cannot be used in combination with `port` or `scheme` definition. - - ```yaml - traefik.http.services..loadbalancer.server.url=http://foobar:8080 - ``` - -??? info "`traefik.http.services..loadbalancer.server.weight`" - - Overrides the default weight. - - ```yaml - traefik.http.services.myservice.loadbalancer.server.weight=42 - ``` - -??? info "`traefik.http.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../http/load-balancing/serverstransport.md) for more information. - - ```yaml - - "traefik.http.services..loadbalancer.serverstransport=foobar@file" - ``` - -??? info "`traefik.http.services..loadbalancer.passhostheader`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.passhostheader=true" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.headers.`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.headers.X-Foo=foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.hostname`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.hostname=example.org" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.interval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.interval=10s" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.unhealthyinterval`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.unhealthyinterval=10s" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.path`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.path=/foo" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.method`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.method=foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.status`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.status=42" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.port`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.port=42" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.scheme`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.scheme=http" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.timeout`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.timeout=10s" - ``` - -??? info "`traefik.http.services..loadbalancer.healthcheck.followredirects`" - - See [health check](../http/load-balancing/service.md#health-check) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.healthcheck.followredirects=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.httponly`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie.httponly=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.name`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie.name=foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.path`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie.path=/foobar" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.secure`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie.secure=true" - ``` - -??? info "`traefik.http.services..loadbalancer.sticky.cookie.samesite`" - - ```yaml - - "traefik.http.services.myservice.loadbalancer.sticky.cookie.samesite=none" - ``` - -??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - See [response forwarding](../http/load-balancing/service.md#configuration-options) for more information. - - ```yaml - - "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.http.services..loadbalancer.server.port` | Registers a port.
Useful when the container exposes multiples ports.
Mandatory for Docker Swarm (see the section ["Port Detection with Docker Swarm"](../../install-configuration/providers/swarm.md#port-detection)). | `8080` | +| `traefik.http.services..loadbalancer.server.scheme` | Overrides the default scheme. | `http` | +| `traefik.http.services..loadbalancer.server.url` | Defines the service URL.
This option cannot be used in combination with `port` or `scheme` definition. | `http://foobar:8080` | +| `traefik.http.services..loadbalancer.server.weight` | Overrides the default weight. | `42` | +| `traefik.http.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../http/load-balancing/serverstransport.md) for more information. | `foobar@file` | +| `traefik.http.services..loadbalancer.passhostheader` | | `true` | +| `traefik.http.services..loadbalancer.healthcheck.headers.` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.hostname` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `example.org` | +| `traefik.http.services..loadbalancer.healthcheck.interval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10s` | +| `traefik.http.services..loadbalancer.healthcheck.unhealthyinterval` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10s` | +| `traefik.http.services..loadbalancer.healthcheck.path` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `/foo` | +| `traefik.http.services..loadbalancer.healthcheck.method` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `foobar` | +| `traefik.http.services..loadbalancer.healthcheck.status` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.port` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `42` | +| `traefik.http.services..loadbalancer.healthcheck.scheme` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `http` | +| `traefik.http.services..loadbalancer.healthcheck.timeout` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `10s` | +| `traefik.http.services..loadbalancer.healthcheck.followredirects` | See [health check](../http/load-balancing/service.md#health-check) for more information. | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.httponly` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.name` | | `foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.path` | | `/foobar` | +| `traefik.http.services..loadbalancer.sticky.cookie.secure` | | `true` | +| `traefik.http.services..loadbalancer.sticky.cookie.samesite` | | `none` | +| `traefik.http.services..loadbalancer.responseforwarding.flushinterval` | See [response forwarding](../http/load-balancing/service.md#configuration-options) for more information. | `10` | ### Middleware @@ -519,125 +268,31 @@ You can declare TCP Routers and/or Services using labels. #### TCP Routers -??? info "`traefik.tcp.routers..entrypoints`" +##### Configuration Options - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.entrypoints=ep1,ep2" - ``` - -??? info "`traefik.tcp.routers..rule`" - - See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.rule=HostSNI(`example.com`)" - ``` - -??? info "`traefik.tcp.routers..ruleSyntax`" - - !!! warning - - RuleSyntax option is deprecated and will be removed in the next major version. - Please do not use this field and rewrite the router rules to use the v3 syntax. - - configure the rule syntax to be used for parsing the rule on a per-router basis. - - ```yaml - traefik.tcp.routers.mytcprouter.ruleSyntax=v3 - ``` - -??? info "`traefik.tcp.routers..service`" - - See [service](../tcp/service.md) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.service=myservice" - ``` - -??? info "`traefik.tcp.routers..tls`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.tls=true" - ``` - -??? info "`traefik.tcp.routers..tls.certresolver`" - - See [certResolver](../tcp/tls.md#configuration-options) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.tls.certresolver=myresolver" - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].main`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.tls.domains[0].main=example.org" - ``` - -??? info "`traefik.tcp.routers..tls.domains[n].sans`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.tls.domains[0].sans=test.example.org,dev.example.org" - ``` - -??? info "`traefik.tcp.routers..tls.options`" - - See [TLS](../tcp/tls.md) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.tls.options=mysoptions" - ``` - -??? info "`traefik.tcp.routers..tls.passthrough`" - - See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. - - ```yaml - - "traefik.tcp.routers.mytcprouter.tls.passthrough=true" - ``` - -??? info "`traefik.tcp.routers..priority`" - - See [priority](../tcp/routing/rules-and-priority.md) for more information. - - ```yaml - - "traefik.tcp.routers.myrouter.priority=42" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.tcp.routers..rule` | See [rule](../tcp/routing/rules-and-priority.md#rules) for more information. | ```HostSNI(`example.com`)``` | +| `traefik.tcp.routers..ruleSyntax` | configure the rule syntax to be used for parsing the rule on a per-router basis.
RuleSyntax option is deprecated and will be removed in the next major version.
Please do not use this field and rewrite the router rules to use the v3 syntax. | `v3` | +| `traefik.tcp.routers..service` | See [service](../tcp/service.md) for more information. | `myservice` | +| `traefik.tcp.routers..tls` | See [TLS](../tcp/tls.md) for more information. | `true` | +| `traefik.tcp.routers..tls.certresolver` | See [certResolver](../tcp/tls.md#configuration-options) for more information. | `myresolver` | +| `traefik.tcp.routers..tls.domains[n].main` | See [TLS](../tcp/tls.md) for more information. | `example.org` | +| `traefik.tcp.routers..tls.domains[n].sans` | See [TLS](../tcp/tls.md) for more information. | `test.example.org,dev.example.org` | +| `traefik.tcp.routers..tls.options` | See [TLS](../tcp/tls.md) for more information. | `mysoptions` | +| `traefik.tcp.routers..tls.passthrough` | See [Passthrough](../tcp/tls.md#opt-passthrough) for more information. | `true` | +| `traefik.tcp.routers..priority` | See [priority](../tcp/routing/rules-and-priority.md#priority-calculation) for more information. | `42` | #### TCP Services -??? info "`traefik.tcp.services..loadbalancer.server.port`" +##### Configuration Options - Registers a port of the application. - - ```yaml - - "traefik.tcp.services.mytcpservice.loadbalancer.server.port=423" - ``` - -??? info "`traefik.tcp.services..loadbalancer.server.tls`" - - Determines whether to use TLS when dialing with the backend. - - ```yaml - - "traefik.tcp.services.mytcpservice.loadbalancer.server.tls=true" - ``` - -??? info "`traefik.tcp.services..loadbalancer.serverstransport`" - - Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one. - See [serverstransport](../tcp/serverstransport.md) for more information. - - ```yaml - - "traefik.tcp.services..loadbalancer.serverstransport=foobar@file" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.tcp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | +| `traefik.tcp.services..loadbalancer.server.tls` | Determines whether to use TLS when dialing with the backend. | `true` | +| `traefik.tcp.services..loadbalancer.serverstransport` | Allows to reference a ServersTransport resource that is defined either with the File provider or the Kubernetes CRD one.
See [serverstransport](../tcp/serverstransport.md) for more information. | `foobar@file` | #### TCP Middleware @@ -684,65 +339,25 @@ You can declare UDP Routers and/or Services using labels. #### UDP Routers -??? info "`traefik.udp.routers..entrypoints`" +##### Configuration Options - See [entry points](../../install-configuration/entrypoints.md) for more information. - - ```yaml - - "traefik.udp.routers.myudprouter.entrypoints=ep1,ep2" - ``` - -??? info "`traefik.udp.routers..service`" - - See [service](../udp/service.md) for more information. - - ```yaml - - "traefik.udp.routers.myudprouter.service=myservice" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.routers..entrypoints` | See [entry points](../../install-configuration/entrypoints.md) for more information. | `ep1,ep2` | +| `traefik.udp.routers..service` | See [service](../udp/service.md) for more information. | `myservice` | #### UDP Services -??? info "`traefik.udp.services..loadbalancer.server.port`" +##### Configuration Options - Registers a port of the application. - - ```yaml - - "traefik.udp.services.myudpservice.loadbalancer.server.port=423" - ``` +| Label | Description | Value | +|------|-------------|-------| +| `traefik.udp.services..loadbalancer.server.port` | Registers a port of the application. | `423` | ### Specific Provider Options -#### `traefik.enable` - -```yaml -- "traefik.enable=true" -``` - -You can tell Traefik to consider (or not) the container by setting `traefik.enable` to true or false. - -This option overrides the value of `exposedByDefault`. - -#### `traefik.swarm.network` - -```yaml -- "traefik.swarm.network=mynetwork" -``` - -Overrides the default docker network to use for connections to the container. - -If a container is linked to several networks, be sure to set the proper network name (you can check this with `docker inspect `), -otherwise it will randomly pick one (depending on how docker is returning them). - -!!! warning - When deploying a stack from a compose file `stack`, the networks defined are prefixed with `stack`. - -#### `traefik.swarm.lbswarm` - -```yaml -- "traefik.swarm.lbswarm=true" -``` - -Enables Swarm's inbuilt load balancer (only relevant in Swarm Mode). - -If you enable this option, Traefik will use the virtual IP provided by docker swarm instead of the containers IPs. -Which means that Traefik will not perform any kind of load balancing and will delegate this task to swarm. +| Label | Description | Value | +|------|-------------|-------| +| `traefik.enable` | You can tell Traefik to consider (or not) the container by setting `traefik.enable` to true or false.
This option overrides the value of `exposedByDefault`. | `true` | +| `traefik.swarm.network` | Overrides the default docker network to use for connections to the container.
If a container is linked to several networks, be sure to set the proper network name (you can check this with `docker inspect `), otherwise it will randomly pick one (depending on how docker is returning them).

When deploying a stack from a compose file `stack`, the networks defined are prefixed with `stack`. | `mynetwork` | +| `traefik.swarm.lbswarm` | Enables Swarm's inbuilt load balancer (only relevant in Swarm Mode).
If you enable this option, Traefik will use the virtual IP provided by docker swarm instead of the containers IPs.
Which means that Traefik will not perform any kind of load balancing and will delegate this task to swarm. | `true` |