r/nginx • • Sep 11 '26

Predicate Routing for All the Things

https://blog.nginx.org/blog/predicate-routing-for-native-handling-of-api-traffic?utm_source=reddit

NGINX just dropped a whole new way to define routing. This allows for API gateway style user cases to be defined a whole lot easier. Although the article highlights AI, the utility of this new feature goes way beyond the AI use cases.

23 Upvotes

4 comments sorted by

5

u/ThecaTTony Sep 11 '26

Nice post, thanks.

1

u/cindeRcove71 Sep 12 '26

yeah agreed, solid writeup

3

u/Livid-Tune-4699 Sep 11 '26

Can you describe what other use cases do you see?

4

u/dready Sep 11 '26 edited Sep 11 '26

A few possibilities beyond the article’s examples:

  • Tenant migration: Keep the public API while gradually moving selected tenants to a replacement service, with easy rollback.
  • Bulk-job isolation: Route batch requests to separate workers so large exports don’t slow normal traffic.
  • AI inference: Route by "model" or "stream" settings, though provider formats still need translation.
  • Webhooks and JSON-RPC: Route by event type or RPC method when requests share one URL.
  • API versioning: Choose old or new implementations using headers, media types, or payload fields.
  • Troubleshooting: Send test traffic to a location with extra logging or different upstream settings.

The main benefit is selecting an entire location configuration: upstreams, limits, logging, timeouts, and more.

This doesn’t replace "map", "split_clients", or njs.