EntryPoints
Defining Network Entry Points for Incoming Traffic
EntryPoints are the network entry points into Traefik. They define the ports on which Traefik listens for incoming connections and whether to use TCP or UDP protocols.
Basic Configuration
Defining EntryPoints
EntryPoints are part of the static configuration and must be defined at startup.
entryPoints :
web :
address : ":80"
websecure :
address : ":443"
metrics :
address : ":8080"
[ entryPoints ]
[ entryPoints . web ]
address = ":80"
[ entryPoints . websecure ]
address = ":443"
[ entryPoints . metrics ]
address = ":8080"
--entryPoints.web.address =:80 \
--entryPoints.websecure.address=:443 \
--entryPoints.metrics.address=:8080
The address format is: [host]:port[/tcp|/udp]
Port only : :80 - Listen on all interfaces on port 80 (TCP by default)
Host and port : 192.168.1.10:8080 - Listen on specific IP
IPv6 : [::1]:80 - IPv6 localhost
UDP : :53/udp - Listen on UDP port 53
TCP (explicit) : :80/tcp - Explicitly specify TCP
Port 80 Only
Specific IP Address
UDP Protocol
Both TCP and UDP on Same Port
entryPoints :
web :
address : ":80"
HTTP Configuration
Automatic HTTPS Redirection
Redirect all HTTP traffic to HTTPS:
entryPoints :
web :
address : ":80"
http :
redirections :
entryPoint :
to : websecure
scheme : https
permanent : true
websecure :
address : ":443"
[ entryPoints . web ]
address = ":80"
[ entryPoints . web . http . redirections . entryPoint ]
to = "websecure"
scheme = "https"
permanent = true
[ entryPoints . websecure ]
address = ":443"
Target EntryPoint name or port (e.g., websecure or :443)
Redirection scheme (http or https)
Use 301 (permanent) vs 302 (temporary) redirect
TLS Configuration
Configure default TLS settings for all routers on this EntryPoint:
entryPoints :
websecure :
address : ":443"
http :
tls :
certResolver : letsencrypt
domains :
- main : "example.com"
sans :
- "*.example.com"
- main : "example.org"
sans :
- "*.example.org"
[ entryPoints . websecure ]
address = ":443"
[ entryPoints . websecure . http . tls ]
certResolver = "letsencrypt"
[[ entryPoints . websecure . http . tls . domains ]]
main = "example.com"
sans = [ "*.example.com" ]
[[ entryPoints . websecure . http . tls . domains ]]
main = "example.org"
sans = [ "*.example.org" ]
Middlewares
Apply middlewares to all routers on this EntryPoint:
entryPoints :
websecure :
address : ":443"
http :
middlewares :
- security-headers@file
- rate-limit@file
[ entryPoints . websecure ]
address = ":443"
[ entryPoints . websecure . http ]
middlewares = [ "security-headers@file" , "rate-limit@file" ]
Transport Configuration
Timeouts
Configure connection timeouts:
entryPoints :
web :
address : ":80"
transport :
respondingTimeouts :
readTimeout : "60s"
writeTimeout : "60s"
idleTimeout : "180s"
lifeCycle :
requestAcceptGraceTimeout : "10s"
graceTimeOut : "10s"
[ entryPoints . web ]
address = ":80"
[ entryPoints . web . transport . respondingTimeouts ]
readTimeout = "60s"
writeTimeout = "60s"
idleTimeout = "180s"
[ entryPoints . web . transport . lifeCycle ]
requestAcceptGraceTimeout = "10s"
graceTimeOut = "10s"
Maximum duration for reading the entire request including body
Maximum duration before timing out writes of the response
Maximum duration an idle keep-alive connection remains open
Duration to give active requests a chance to finish during shutdown
HTTP/2 Configuration
Configure HTTP/2 settings:
entryPoints :
websecure :
address : ":443"
http2 :
maxConcurrentStreams : 250
maxDecoderHeaderTableSize : 4096
maxEncoderHeaderTableSize : 4096
[ entryPoints . websecure ]
address = ":443"
[ entryPoints . websecure . http2 ]
maxConcurrentStreams = 250
maxDecoderHeaderTableSize = 4096
maxEncoderHeaderTableSize = 4096
Number of concurrent streams per connection each client can initiate
HTTP/3 Configuration
Enable HTTP/3 support:
entryPoints :
websecure :
address : ":443"
http3 :
advertisedPort : 443
[ entryPoints . websecure ]
address = ":443"
[ entryPoints . websecure . http3 ]
advertisedPort = 443
HTTP/3 requires a TCP EntryPoint as HTTP/3 always starts as TCP and upgrades to UDP. The EntryPoint automatically listens on UDP for HTTP/3 traffic.
Proxy Protocol
Enable PROXY protocol support for client IP preservation:
entryPoints :
web :
address : ":80"
proxyProtocol :
trustedIPs :
- "192.168.1.0/24"
- "172.16.0.0/16"
[ entryPoints . web ]
address = ":80"
[ entryPoints . web . proxyProtocol ]
trustedIPs = [ "192.168.1.0/24" , "172.16.0.0/16" ]
Only enable insecure: true in testing environments. In production, always specify trustedIPs to prevent IP spoofing.
Trust X-Forwarded-* headers from specific IPs:
entryPoints :
web :
address : ":80"
forwardedHeaders :
trustedIPs :
- "127.0.0.1/32"
- "192.168.1.7"
[ entryPoints . web ]
address = ":80"
[ entryPoints . web . forwardedHeaders ]
trustedIPs = [ "127.0.0.1/32" , "192.168.1.7" ]
Advanced Options
AsDefault
Mark an EntryPoint as default for routers without explicit EntryPoints:
entryPoints :
web :
address : ":80"
websecure :
address : ":443"
asDefault : true
[ entryPoints . web ]
address = ":80"
[ entryPoints . websecure ]
address = ":443"
asDefault = true
ReusePort
Enable SO_REUSEPORT for multiple processes listening on the same port:
entryPoints :
web :
address : ":80"
reusePort : true
[ entryPoints . web ]
address = ":80"
reusePort = true
ReusePort is only supported on Linux, FreeBSD, OpenBSD, and Darwin. It’s useful for zero-downtime deployments.
Complete Example
entryPoints :
# HTTP EntryPoint with redirect to HTTPS
web :
address : ":80"
http :
redirections :
entryPoint :
to : websecure
scheme : https
forwardedHeaders :
trustedIPs :
- "192.168.1.0/24"
# HTTPS EntryPoint with TLS
websecure :
address : ":443"
asDefault : true
http :
tls :
certResolver : letsencrypt
middlewares :
- security-headers@file
http2 :
maxConcurrentStreams : 250
http3 :
advertisedPort : 443
transport :
respondingTimeouts :
readTimeout : "60s"
idleTimeout : "180s"
lifeCycle :
graceTimeOut : "30s"
# Metrics EntryPoint (internal only)
metrics :
address : "127.0.0.1:8080"
# HTTP EntryPoint with redirect to HTTPS
[ entryPoints . web ]
address = ":80"
[ entryPoints . web . http . redirections . entryPoint ]
to = "websecure"
scheme = "https"
[ entryPoints . web . forwardedHeaders ]
trustedIPs = [ "192.168.1.0/24" ]
# HTTPS EntryPoint with TLS
[ entryPoints . websecure ]
address = ":443"
asDefault = true
[ entryPoints . websecure . http . tls ]
certResolver = "letsencrypt"
[ entryPoints . websecure . http ]
middlewares = [ "security-headers@file" ]
[ entryPoints . websecure . http2 ]
maxConcurrentStreams = 250
[ entryPoints . websecure . http3 ]
advertisedPort = 443
[ entryPoints . websecure . transport . respondingTimeouts ]
readTimeout = "60s"
idleTimeout = "180s"
[ entryPoints . websecure . transport . lifeCycle ]
graceTimeOut = "30s"
# Metrics EntryPoint (internal only)
[ entryPoints . metrics ]
address = "127.0.0.1:8080"