EntryPoints

Opening Connections for Incoming Requests

entryPoints

EntryPoints are the network entry points into Traefik. They define the port which will receive the packets, and whether to listen for TCP or UDP.

Configuration Examples

Port 80 only

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.web]
  4. address = ":80"
  1. ## Static configuration
  2. entryPoints:
  3. web:
  4. address: ":80"
  1. ## Static configuration
  2. --entryPoints.web.address=:80

We define an entrypoint called web that will listen on port 80.

Port 80 & 443

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.web]
  4. address = ":80"
  5. [entryPoints.websecure]
  6. address = ":443"
  1. ## Static configuration
  2. entryPoints:
  3. web:
  4. address: ":80"
  5. websecure:
  6. address: ":443"
  1. ## Static configuration
  2. --entryPoints.web.address=:80
  3. --entryPoints.websecure.address=:443
  • Two entrypoints are defined: one called web, and the other called websecure.
  • web listens on port 80, and websecure on port 443.

UDP on port 1704

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.streaming]
  4. address = ":1704/udp"
  1. ## Static configuration
  2. entryPoints:
  3. streaming:
  4. address: ":1704/udp"
  1. ## Static configuration
  2. --entryPoints.streaming.address=:1704/udp

Configuration

General

EntryPoints are part of the static configuration. They can be defined by using a file (TOML or YAML) or CLI arguments.

See the complete reference for the list of available options

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.name]
  4. address = ":8888" # same as ":8888/tcp"
  5. [entryPoints.name.transport]
  6. [entryPoints.name.transport.lifeCycle]
  7. requestAcceptGraceTimeout = 42
  8. graceTimeOut = 42
  9. [entryPoints.name.transport.respondingTimeouts]
  10. readTimeout = 42
  11. writeTimeout = 42
  12. idleTimeout = 42
  13. [entryPoints.name.proxyProtocol]
  14. insecure = true
  15. trustedIPs = ["127.0.0.1", "192.168.0.1"]
  16. [entryPoints.name.forwardedHeaders]
  17. insecure = true
  18. trustedIPs = ["127.0.0.1", "192.168.0.1"]
  1. ## Static configuration
  2. entryPoints:
  3. name:
  4. address: ":8888" # same as ":8888/tcp"
  5. transport:
  6. lifeCycle:
  7. requestAcceptGraceTimeout: 42
  8. graceTimeOut: 42
  9. respondingTimeouts:
  10. readTimeout: 42
  11. writeTimeout: 42
  12. idleTimeout: 42
  13. proxyProtocol:
  14. insecure: true
  15. trustedIPs:
  16. - "127.0.0.1"
  17. - "192.168.0.1"
  18. forwardedHeaders:
  19. insecure: true
  20. trustedIPs:
  21. - "127.0.0.1"
  22. - "192.168.0.1"
  1. ## Static configuration
  2. --entryPoints.name.address=:8888 # same as :8888/tcp
  3. --entryPoints.name.transport.lifeCycle.requestAcceptGraceTimeout=42
  4. --entryPoints.name.transport.lifeCycle.graceTimeOut=42
  5. --entryPoints.name.transport.respondingTimeouts.readTimeout=42
  6. --entryPoints.name.transport.respondingTimeouts.writeTimeout=42
  7. --entryPoints.name.transport.respondingTimeouts.idleTimeout=42
  8. --entryPoints.name.proxyProtocol.insecure=true
  9. --entryPoints.name.proxyProtocol.trustedIPs=127.0.0.1,192.168.0.1
  10. --entryPoints.name.forwardedHeaders.insecure=true
  11. --entryPoints.name.forwardedHeaders.trustedIPs=127.0.0.1,192.168.0.1

Address

The address defines the port, and optionally the hostname, on which to listen for incoming connections and packets. It also defines the protocol to use (TCP or UDP). If no protocol is specified, the default is TCP. The format is:

  1. [host]:port[/tcp|/udp]

If both TCP and UDP are wanted for the same port, two entryPoints definitions are needed, such as in the example below.

Both TCP and UDP on port 3179

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.tcpep]
  4. address = ":3179"
  5. [entryPoints.udpep]
  6. address = ":3179/udp"
  1. ## Static configuration
  2. entryPoints:
  3. tcpep:
  4. address: ":3179"
  5. udpep:
  6. address: ":3179/udp"
  1. ## Static configuration
  2. --entryPoints.tcpep.address=:3179
  3. --entryPoints.udpep.address=:3179/udp

Forwarded Headers

You can configure Traefik to trust the forwarded headers information (X-Forwarded-*).

forwardedHeaders.trustedIPs

Trusting Forwarded Headers from specific IPs.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.web]
  4. address = ":80"
  5. [entryPoints.web.forwardedHeaders]
  6. trustedIPs = ["127.0.0.1/32", "192.168.1.7"]
  1. ## Static configuration
  2. entryPoints:
  3. web:
  4. address: ":80"
  5. forwardedHeaders:
  6. trustedIPs:
  7. - "127.0.0.1/32"
  8. - "192.168.1.7"
  1. ## Static configuration
  2. --entryPoints.web.address=:80
  3. --entryPoints.web.forwardedHeaders.trustedIPs=127.0.0.1/32,192.168.1.7

forwardedHeaders.insecure

Insecure Mode (Always Trusting Forwarded Headers).

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.web]
  4. address = ":80"
  5. [entryPoints.web.forwardedHeaders]
  6. insecure = true
  1. ## Static configuration
  2. entryPoints:
  3. web:
  4. address: ":80"
  5. forwardedHeaders:
  6. insecure: true
  1. ## Static configuration
  2. --entryPoints.web.address=:80
  3. --entryPoints.web.forwardedHeaders.insecure

Transport

respondingTimeouts

respondingTimeouts are timeouts for incoming requests to the Traefik instance. Setting them has no effect for UDP entryPoints.

transport.respondingTimeouts.readTimeout

Optional, Default=0s

readTimeout is the maximum duration for reading the entire request, including the body.

If zero, no timeout exists.

Can be provided in a format supported by time.ParseDuration or as raw values (digits). If no units are provided, the value is parsed assuming seconds.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.name]
  4. address = ":8888"
  5. [entryPoints.name.transport]
  6. [entryPoints.name.transport.respondingTimeouts]
  7. readTimeout = 42
  1. ## Static configuration
  2. entryPoints:
  3. name:
  4. address: ":8888"
  5. transport:
  6. respondingTimeouts:
  7. readTimeout: 42
  1. ## Static configuration
  2. --entryPoints.name.address=:8888
  3. --entryPoints.name.transport.respondingTimeouts.readTimeout=42

transport.respondingTimeouts.writeTimeout

Optional, Default=0s

writeTimeout is the maximum duration before timing out writes of the response.

It covers the time from the end of the request header read to the end of the response write. If zero, no timeout exists.

Can be provided in a format supported by time.ParseDuration or as raw values (digits). If no units are provided, the value is parsed assuming seconds.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.name]
  4. address = ":8888"
  5. [entryPoints.name.transport]
  6. [entryPoints.name.transport.respondingTimeouts]
  7. writeTimeout = 42
  1. ## Static configuration
  2. entryPoints:
  3. name:
  4. address: ":8888"
  5. transport:
  6. respondingTimeouts:
  7. writeTimeout: 42
  1. ## Static configuration
  2. --entryPoints.name.address=:8888
  3. --entryPoints.name.transport.respondingTimeouts.writeTimeout=42

transport.respondingTimeouts.idleTimeout

Optional, Default=180s

idleTimeout is the maximum duration an idle (keep-alive) connection will remain idle before closing itself.

If zero, no timeout exists.

Can be provided in a format supported by time.ParseDuration or as raw values (digits). If no units are provided, the value is parsed assuming seconds.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.name]
  4. address = ":8888"
  5. [entryPoints.name.transport]
  6. [entryPoints.name.transport.respondingTimeouts]
  7. idleTimeout = 42
  1. ## Static configuration
  2. entryPoints:
  3. name:
  4. address: ":8888"
  5. transport:
  6. respondingTimeouts:
  7. idleTimeout: 42
  1. ## Static configuration
  2. --entryPoints.name.address=:8888
  3. --entryPoints.name.transport.respondingTimeouts.idleTimeout=42

lifeCycle

Controls the behavior of Traefik during the shutdown phase.

lifeCycle.requestAcceptGraceTimeout

Optional, Default=0s

Duration to keep accepting requests prior to initiating the graceful termination period (as defined by the graceTimeOut option). This option is meant to give downstream load-balancers sufficient time to take Traefik out of rotation.

Can be provided in a format supported by time.ParseDuration or as raw values (digits).

If no units are provided, the value is parsed assuming seconds. The zero duration disables the request accepting grace period, i.e., Traefik will immediately proceed to the grace period.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.name]
  4. address = ":8888"
  5. [entryPoints.name.transport]
  6. [entryPoints.name.transport.lifeCycle]
  7. requestAcceptGraceTimeout = 42
  1. ## Static configuration
  2. entryPoints:
  3. name:
  4. address: ":8888"
  5. transport:
  6. lifeCycle:
  7. requestAcceptGraceTimeout: 42
  1. ## Static configuration
  2. --entryPoints.name.address=:8888
  3. --entryPoints.name.transport.lifeCycle.requestAcceptGraceTimeout=42

lifeCycle.graceTimeOut

Optional, Default=10s

Duration to give active requests a chance to finish before Traefik stops.

Can be provided in a format supported by time.ParseDuration or as raw values (digits).

If no units are provided, the value is parsed assuming seconds.

In this time frame no new requests are accepted.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.name]
  4. address = ":8888"
  5. [entryPoints.name.transport]
  6. [entryPoints.name.transport.lifeCycle]
  7. graceTimeOut = 42
  1. ## Static configuration
  2. entryPoints:
  3. name:
  4. address: ":8888"
  5. transport:
  6. lifeCycle:
  7. graceTimeOut: 42
  1. ## Static configuration
  2. --entryPoints.name.address=:8888
  3. --entryPoints.name.transport.lifeCycle.graceTimeOut=42

ProxyProtocol

Traefik supports ProxyProtocol version 1 and 2.

If Proxy Protocol header parsing is enabled for the entry point, this entry point can accept connections with or without Proxy Protocol headers.

If the Proxy Protocol header is passed, then the version is determined automatically.

proxyProtocol.trustedIPs

Enabling Proxy Protocol with Trusted IPs.

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.web]
  4. address = ":80"
  5. [entryPoints.web.proxyProtocol]
  6. trustedIPs = ["127.0.0.1/32", "192.168.1.7"]
  1. ## Static configuration
  2. entryPoints:
  3. web:
  4. address: ":80"
  5. proxyProtocol:
  6. trustedIPs:
  7. - "127.0.0.1/32"
  8. - "192.168.1.7"
  1. --entryPoints.web.address=:80
  2. --entryPoints.web.proxyProtocol.trustedIPs=127.0.0.1/32,192.168.1.7

IPs in trustedIPs only will lead to remote client address replacement: Declare load-balancer IPs or CIDR range here.

proxyProtocol.insecure

Insecure Mode (Testing Environment Only).

In a test environments, you can configure Traefik to trust every incoming connection. Doing so, every remote client address will be replaced (trustedIPs won't have any effect)

  1. ## Static configuration
  2. [entryPoints]
  3. [entryPoints.web]
  4. address = ":80"
  5. [entryPoints.web.proxyProtocol]
  6. insecure = true
  1. ## Static configuration
  2. entryPoints:
  3. web:
  4. address: ":80"
  5. proxyProtocol:
  6. insecure: true
  1. --entryPoints.web.address=:80
  2. --entryPoints.web.proxyProtocol.insecure

Queuing Traefik behind Another Load Balancer

When queuing Traefik behind another load-balancer, make sure to configure Proxy Protocol on both sides. Not doing so could introduce a security risk in your system (enabling request forgery).

HTTP Options

This whole section is dedicated to options, keyed by entry point, that will apply only to HTTP routing.

Redirection

HTTPS redirection (80 to 443)

  1. [entryPoints.web]
  2. address = ":80"
  3. [entryPoints.web.http]
  4. [entryPoints.web.http.redirections]
  5. [entryPoints.web.http.redirections.entryPoint]
  6. to = "websecure"
  7. scheme = "https"
  8. [entryPoints.websecure]
  9. address = ":443"
  1. entryPoints:
  2. web:
  3. address: :80
  4. http:
  5. redirections:
  6. entryPoint:
  7. to: websecure
  8. scheme: https
  9. websecure:
  10. address: :443
  1. --entrypoints.web.address=:80
  2. --entrypoints.web.http.redirections.entryPoint.to=websecure
  3. --entrypoints.web.http.redirections.entryPoint.scheme=https
  4. --entrypoints.websecure.address=:443

entryPoint

This section is a convenience to enable (permanent) redirecting of all incoming requests on an entry point (e.g. port 80) to another entry point (e.g. port 443) or an explicit port (:443).

entryPoint.to

Required

The target element, it can be:

  • an entry point name (ex: websecure)
  • a port (:443)
  1. [entryPoints.foo]
  2. # ...
  3. [entryPoints.foo.http.redirections]
  4. [entryPoints.foo.http.redirections.entryPoint]
  5. to = "websecure"
  1. entryPoints:
  2. foo:
  3. # ...
  4. http:
  5. redirections:
  6. entryPoint:
  7. to: websecure
  1. --entrypoints.foo.http.redirections.entryPoint.to=websecure

entryPoint.scheme

Optional, Default="https"

The redirection target scheme.

  1. [entryPoints.foo]
  2. # ...
  3. [entryPoints.foo.http.redirections]
  4. [entryPoints.foo.http.redirections.entryPoint]
  5. # ...
  6. scheme = "https"
  1. entryPoints:
  2. foo:
  3. # ...
  4. http:
  5. redirections:
  6. entryPoint:
  7. # ...
  8. scheme: https
  1. --entrypoints.foo.http.redirections.entryPoint.scheme=https

entryPoint.permanent

Optional, Default=true

To apply a permanent redirection.

  1. [entryPoints.foo]
  2. # ...
  3. [entryPoints.foo.http.redirections]
  4. [entryPoints.foo.http.redirections.entryPoint]
  5. # ...
  6. permanent = true
  1. entryPoints:
  2. foo:
  3. # ...
  4. http:
  5. redirections:
  6. entryPoint:
  7. # ...
  8. permanent: true
  1. --entrypoints.foo.http.redirections.entrypoint.permanent=true

entryPoint.priority

Optional, Default=1

Priority of the generated router.

  1. [entryPoints.foo]
  2. # ...
  3. [entryPoints.foo.http.redirections]
  4. [entryPoints.foo.http.redirections.entryPoint]
  5. # ...
  6. priority = 10
  1. entryPoints:
  2. foo:
  3. # ...
  4. http:
  5. redirections:
  6. entryPoint:
  7. # ...
  8. priority: 10
  1. --entrypoints.foo.http.redirections.entrypoint.priority=10

Middlewares

The list of middlewares that are prepended by default to the list of middlewares of each router associated to the named entry point.

  1. [entryPoints.websecure]
  2. address = ":443"
  3. [entryPoints.websecure.http]
  4. middlewares = ["[email protected]", "[email protected]"]
  1. entryPoints:
  2. websecure:
  3. address: ':443'
  4. http:
  5. middlewares:
  6. - [email protected]
  7. - [email protected]
  1. entrypoints.websecure.address=:443
  2. [email protected],[email protected]

TLS

This section is about the default TLS configuration applied to all routers associated with the named entry point.

If a TLS section (i.e. any of its fields) is user-defined, then the default configuration does not apply at all.

The TLS section is the same as the TLS section on HTTP routers.

  1. [entryPoints.websecure]
  2. address = ":443"
  3. [entryPoints.websecure.http.tls]
  4. options = "foobar"
  5. certResolver = "leresolver"
  6. [[entryPoints.websecure.http.tls.domains]]
  7. main = "example.com"
  8. sans = ["foo.example.com", "bar.example.com"]
  9. [[entryPoints.websecure.http.tls.domains]]
  10. main = "test.com"
  11. sans = ["foo.test.com", "bar.test.com"]
  1. entryPoints:
  2. websecure:
  3. address: ':443'
  4. http:
  5. tls:
  6. options: foobar
  7. certResolver: leresolver
  8. domains:
  9. - main: example.com
  10. sans:
  11. - foo.example.com
  12. - bar.example.com
  13. - main: test.com
  14. sans:
  15. - foo.test.com
  16. - bar.test.com
  1. entrypoints.websecure.address=:443
  2. entrypoints.websecure.http.tls.options=foobar
  3. entrypoints.websecure.http.tls.certResolver=leresolver
  4. entrypoints.websecure.http.tls.domains[0].main=example.com
  5. entrypoints.websecure.http.tls.domains[0].sans=foo.example.com,bar.example.com
  6. entrypoints.websecure.http.tls.domains[1].main=test.com
  7. entrypoints.websecure.http.tls.domains[1].sans=foo.test.com,bar.test.com

Let's Encrypt

  1. [entryPoints.websecure]
  2. address = ":443"
  3. [entryPoints.websecure.http.tls]
  4. certResolver = "leresolver"
  1. entryPoints:
  2. websecure:
  3. address: ':443'
  4. http:
  5. tls:
  6. certResolver: leresolver
  1. entrypoints.websecure.address=:443
  2. entrypoints.websecure.http.tls.certResolver=leresolver