Prompt
What should I use to route APIs by header or path?
Latest observation
Oct 5, 2026
OpenAI APIWeb search: off
If you want to route API traffic by header or path, the usual tool is an API gateway or reverse proxy / ingress controller.
Good options
- NGINX / NGINX Ingress – great for path-based routing, some header-based routing with config
- Kong – strong API gateway, supports header/path/host routing
- Traefik – easy dynamic routing, good in container/Kubernetes setups
- Envoy – very flexible, powerful for advanced routing and service mesh
- AWS API Gateway / ALB / CloudFront – if you’re on AWS
- Apigee / Azure API Management / Kong Enterprise – if you need full API management
Rule of thumb
- Path-based routing like
/v1/*vs/v2/*: use an API gateway or ingress - Header-based routing like
X-Canary: true: use a gateway/proxy that supports header matching - Very simple setup: NGINX or Traefik
- More advanced policies, auth, quotas, observability: Kong or Envoy
Example use cases
- Route
/admin/*to one service and/public/*to another - Send requests with header
X-Experiment: Ato a canary backend - Route
/apito different versions based onAcceptor custom headers
If you tell me your environment—Kubernetes, Docker, AWS, or bare metal—I can recommend the best specific choice.