Edge · Updated 2026-05-24

Traefik vs Nginx

Traefik wins when the backends are dynamic — Kubernetes, Docker Compose, Consul — and you want routing rules to follow services automatically. Nginx wins when the backend list is stable, raw performance matters, or you need its long-tail of modules (auth, caching, mod-security, Lua).

PLATE — REVERSE-PROXY MODELSTRAEFIK · DYNAMICdocker labelsk8s ingressconsul catalogfile (yaml)routerlive, no reload→ backendsvsNGINX · CONFIG-DRIVENnginx.confserver {listen 80;location / {proxy_pass ...}}reloadworker 0worker 1worker 2worker 3→ backendsSERVICE-DISCOVERY · STATIC CONFIG
Traefik
Cloud-native edge router. Discovers services dynamically, no reloads.
Since
2015
By
Traefik Labs
License
MIT (Proxy) / EE
traefik.io ↗
Nginx
High-performance HTTP server and reverse proxy. Battle-tested, config-driven.
Since
2004
By
Igor Sysoev / F5
License
BSD 2-clause
nginx.org ↗

Both reverse-proxy HTTP. The difference is the model. Traefik watches a service registry and rebuilds its router on the fly. Nginx loads a config file and reloads on change. For a Kubernetes shop, Traefik feels native. For a long-running monolith or a static fleet, Nginx is the easier story. And if you searched Nginx vs Traefik rather than the other way round, same page — the order does not change the answer.

Quick takes

If you're…

  • You're running on Kubernetes and want routes from Ingress resources automatically Traefik Traefik's built-in K8s provider does this without templating or reloads.
  • You need to serve high-QPS static content with aggressive caching Nginx Nginx's proxy_cache + sendfile + worker model is built for this exact workload.
  • Your backends come and go (Docker Compose, Nomad, ECS) Traefik Service-discovery-as-routing is what Traefik does best.
  • You need ModSecurity, mod_substitute, or any of the long-tail nginx modules Nginx Traefik's plugin ecosystem is much thinner.
  • You want automatic Let's Encrypt certificates with zero config Traefik Traefik ships ACME with HTTP-01 / DNS-01 / TLS-ALPN-01 out of the box.
  • You're writing custom routing logic in Lua Nginx OpenResty turns nginx into a programmable application server. Traefik has plugins but not at this depth.
  • You need a dashboard to watch traffic and live routes Traefik Traefik's dashboard is in-box; nginx needs nginx-amplify or an external metrics stack.
  • You need the lowest possible latency at extreme concurrency Nginx Nginx's event-driven worker model is still the fastest reverse proxy benchmark.
Decision wizard

A few questions, a verdict.

Q1

Where do your backends live?

Q2

What is the primary workload?

Q3

Cert management?

Q4

Operational preferences?

At a glance

The scorecard.

Dimension
Traefik
Nginx
Edge
Dynamic discovery, no reloads
Static config + reload
Traefik
Built-in ACME, multi-challenge
Native TLS, external ACME
Traefik
Solid; ~10-30% behind nginx at the top
Reference-class raw perf
Nginx
Middleware-first; smaller plugin world
Larger module catalog + Lua
depends
Dashboard, metrics, tracing in-box
Logs in-box; metrics/tracing bolt-on
Traefik
HTTP/3 mature; cloud-native focus
HTTP/3 added 2023; mature elsewhere
Traefik
Younger; cloud-native focus
Older; vast deployed base
depends
OSS Proxy free + paid EE/Hub
OSS nginx free + paid Plus
tie
In depth

Dimension by dimension.

core

Configuration model

edge: Traefik
Traefik

Dynamic discovery. Reads Docker labels, Kubernetes Ingress/IngressRoute, Consul catalog, file providers. Reconfigures the router live without restart.

Nginx

Static configuration file (nginx.conf, optional includes). Templated by Ansible, Helm, or Consul-template. Reload is fast (graceful, no dropped connections) but explicit.

features

TLS and certificates

edge: Traefik
Traefik

Built-in ACME (Let's Encrypt, ZeroSSL). HTTP-01, DNS-01, TLS-ALPN-01 challenges. Cluster mode shares certs via Redis or Consul.

Nginx

Native TLS termination, no built-in ACME. Pair with certbot, cert-manager, or your own pipeline.

core

Raw performance

edge: Nginx
Traefik

Solid. Plenty fast for most workloads. About 10-30% slower than nginx at extreme concurrency in head-to-head reverse-proxy benchmarks.

Nginx

Reference point. Event-driven worker model, sendfile, sendfile + tls_sendfile, very small per-connection memory. The performance ceiling.

features

Middleware / plugins

depends
Traefik

Middleware concept built in: rate limit, IP allowlist, basic auth, retries, circuit breaker, compress. Plugin system (Yaegi-based) for custom Go middleware.

Nginx

Modules compiled in (or loaded). ModSecurity, mod_substitute, image_filter, http_secure_link, plus the OpenResty / Lua ecosystem for arbitrary logic.

ops

Observability

edge: Traefik
Traefik

Built-in dashboard, Prometheus metrics, OpenTelemetry tracing, access logs in many formats. Zero extra components.

Nginx

Access log to file (or syslog). Prometheus exporter exists as a third party. Tracing requires nginx-otel module. Commercial nginx-plus has a dashboard.

features

HTTP/3 and modern protocols

edge: Traefik
Traefik

HTTP/3 via QUIC since v3.x. WebSockets, gRPC, TCP/UDP routing as first-class. The roadmap is cloud-native.

Nginx

HTTP/3 since 1.25 (mainline, experimental). WebSockets, gRPC supported. UDP via stream module.

ecosystem

Community and history

depends
Traefik

14k+ stars, 7 years old, Traefik Labs sells enterprise. Cloud-native focus, healthy community, active development.

Nginx

~20+ years. Powers a huge fraction of the internet. Massive Stack Overflow corpus. F5 stewardship sometimes makes the community nervous; the freenginx fork (2024) is one response.

ops

Operational cost

tie
Traefik

OSS Proxy is free. Traefik Enterprise / Hub for multi-cluster, distributed rate limit, OIDC pipelines.

Nginx

OSS nginx is free. F5 Nginx Plus adds JWT auth, monitoring dashboard, advanced load balancing — paid per instance.

Benchmark

The benchmark: reverse-proxy throughput, 1 KB response, keep-alive

wrk benchmark, 8 connections, 4 threads, c5.xlarge upstream, target serving fixed 1 KB body. Default tuning on both. Two backends, round-robin. Numbers reproduced from Sysbench + the Traefik vs Nginx public test suite.

Metric
Traefik
Nginx
Better
Requests/sec
Nginx leads at peak by ~38%.
42k rps
58k rps
Nginx
p99 latency
4.2 ms
2.8 ms
Nginx
Memory at idle
Go runtime vs C process.
38 MB
12 MB
Nginx
CPU at peak load
78 %
62 %
Nginx

Source: wrk + Traefik vs Nginx public benchmark ↗

Kubernetes

Traefik vs NGINX Ingress Controller.

On Kubernetes you are not choosing between the raw proxies anymore. You are choosing between ingress controllers, and the names are a trap.

Three products get collapsed into "nginx ingress" in conversation. ingress-nginx is the community controller the Kubernetes project maintained for years, built on open-source nginx and configured through annotations. NGINX Ingress Controller is F5's separate product, also built on nginx (optionally NGINX Plus). And Traefik runs as an ingress controller natively, with its own CRDs. The first two share a name and almost nothing else — different annotations, different config, different maintainers.

The operating model changes inside a cluster. Nobody edits nginx.conf or a Traefik config file by hand; routes come from Ingress resources, Gateway API objects, or Traefik's IngressRoute CRD, and the controller turns them into live proxy config. Certificates usually move to cert-manager, since they need to live in Secrets that survive pod restarts. Traffic splitting is canary annotations on ingress-nginx versus a weighted TraefikService on Traefik. And the raw-performance gap between the two proxies matters less here, because kube-proxy and the CNI add their own overhead either way.

The field has also tilted. The Kubernetes project retired ingress-nginx — the retirement announcement on the Kubernetes blog ends best-effort maintenance, with no further releases or security fixes, and points users at Gateway API as the way forward (the ingress2gateway tool converts existing resources). Traefik implements Gateway API alongside its own CRDs, which makes it a natural landing spot for clusters leaving ingress-nginx. F5's NGINX Ingress Controller continues and makes sense if you are paying for NGINX Plus features anyway. Starting a new cluster on ingress-nginx is the one clearly wrong answer left.

Switching

Moving from Nginx to Traefik.

The mechanical part of an nginx to Traefik migration is translating server and location blocks into routers, services, and middlewares. Run both side by side, point one low-stakes hostname at Traefik, and move the rest as confidence builds — there is no cutover day. Let Traefik's ACME take over each certificate as its hostname moves.

What actually stops migrations is the config that does not translate: Lua scripts, proxy_cache, ModSecurity, and the long tail of nginx modules have no Traefik equivalent. Inventory those first. If your nginx.conf is mostly proxy_pass and TLS, the move is a weekend. If it is a small application written in config, stay put.

When to pick neither

A different shape of problem.

  • Envoy
    Service-mesh sidecar role, gRPC-first, programmable filter chain
  • Caddy
    You want automatic HTTPS with the simplest possible config
  • HAProxy
    Pure L4/L7 load balancing with the lowest p99 in the field
  • AWS ALB / GCP LB / Cloud Load Balancer
    You're cloud-native and want zero ops on the edge
  • Cloudflare
    You want CDN + WAF + DDoS at the edge, not just routing
  • OpenResty
    You need Nginx + Lua as a programmable application server
Situational picks

For specific cases.

Kubernetes cluster with dozens of microservices

Traefik

IngressRoute objects map directly to Traefik's model. Auto-discovery, ACME, dashboard, OTel — all in box.

High-traffic public website serving static content + CDN origin

Nginx

Nginx's proxy_cache + sendfile + worker model is the canonical answer here. Plenty of operational lore.

Docker Compose dev environment with a handful of services

Traefik

Add a Traefik service + labels on the others. No nginx.conf templating, no reloads.

Legacy monolith on a small set of stable VMs

Nginx

Nginx + a templated config is the lowest-surprise option. Operationally familiar.

You need a programmable edge with custom auth, body rewriting, request shaping

Nginx

OpenResty + Lua is the path. Traefik plugins exist but the depth is not comparable.

You're building a service mesh and need an L7 data plane

Envoy

Both Istio and Linkerd lean on Envoy for the data plane. Different shape of tool entirely.

Sources

Primary material.

Found this useful?