Compared with vendors¶
For Envoy, APISIX, Kong and other gateways you run yourself, see Why a custom proxy.
Why run this proxy if you already have Cloudflare, AWS WAF + CloudFront, Azure Front Door, Google Cloud Armor, Fastly or Akamai?
Don't run it instead of a vendor. Run it behind one when you need application policy the vendors offer only through custom edge code or Enterprise add-ons:
- exact rate limits shared by every node
- limits keyed on a verified identity
- a header contract with your services
- tested, canaried policy changes owned by the application team
If none of those matter, a vendor alone is simpler.
| Mark | Meaning |
|---|---|
| โ | Native |
| โ | Partial, or only on a tier or add-on |
| ๐ | Only by writing edge code (Workers, Lambda@Edge, VCL, EdgeWorkers, Service Extensions) |
| โ | Not available |
| ? | The vendor's docs neither confirm nor rule it out |
Vendor marks link to the vendor's documentation. AFD is Azure Front Door Standard/Premium with WAF. GCA is Google Cloud Armor with Cloud Load Balancing.
Rate limiting¶
| Capability | Proxy | Cloudflare | AWS | AFD | GCA | Fastly | Akamai |
|---|---|---|---|---|---|---|---|
| Exact quota across all nodes | โ | โ per data centre | โ approximate | โ per server | โ per region | โ per POP | โ per node or region |
| Algorithms | โ 4 | โ undocumented | โ estimate, 60 to 600s | โ fixed, 1 or 5 min | โ | โ 1, 10, 60s | โ |
| Key: IP, header, cookie, query | โ | โ IP; rest Enterprise | โ | โ IP, geo | โ no query | โ IP, User-Agent | โ |
| Key: ASN, country | โ | โ Enterprise | โ ASN | โ geo | โ | ๐ | โ condition only |
| Key: verified JWT claim | โ | โ Enterprise | โ | โ | โ | ๐ | โ |
| Penalty after exceeding | โ | โ | โ | โ rest of window | โ | โ | โ |
| Log-only mode | โ | โ Enterprise | โ | โ | โ | โ | โ |
| Chosen behaviour when counting fails | โ | ? | โ fails open | ? | ? | โ in your code | ? |
| Per-IP backstop | โ | โ DDoS only | โ paid | โ Premium | โ Enterprise | โ add-on | โ add-on |
Retry-After, RateLimit headers |
โ | โ Retry-After |
โ static | ? | โ | ๐ | โ static |
Auth, CORS, headers, responses¶
| Capability | Proxy | Cloudflare | AWS | AFD | GCA | Fastly | Akamai |
|---|---|---|---|---|---|---|---|
| JWT validation per route | โ | โ Enterprise | ๐ | โ | ๐ | ๐ | โ API Gateway |
| CORS preflight answered at the edge | โ | ๐ | โ headers only | โ headers only | โ | ๐ | โ |
CORS Vary: Origin, upstream headers replaced |
โ | โ | โ | โ | ? | ๐ | ? |
| Header set, append, remove | โ | โ no append | ๐ | โ | โ | โ | โ |
| Header copy, rename | โ | โ | ๐ | โ | โ | ๐ | โ |
| Forward only listed headers | โ | โ | โ | โ | โ | ๐ | ? |
| Client can't spoof edge headers | โ | โ cf-* only |
โ | โ x-fd-* only |
โ | ๐ | ? |
| Header values from verified claims | โ | โ Enterprise | ๐ | โ | โ | ๐ | โ unverified |
| CR/LF stripped from values | โ | ? | ? | ? | โ | ? | ? |
Locale from Accept-Language |
โ | โ no matching | ๐ | โ | ๐ | ๐ | ๐ |
| Templated error responses | โ | โ fixed tokens | โ static | โ one body | โ static | ๐ | โ |
| Path normalized before matching | โ | โ | โ | โ decode only | โ | ๐ | โ opt-in |
Rules and change safety¶
| Capability | Proxy | Cloudflare | AWS | AFD | GCA | Fastly | Akamai |
|---|---|---|---|---|---|---|---|
| Rule language | โ | โ | โ JSON | โ JSON | โ CEL | โ VCL | โ JSON |
| Validated before activation | โ | ? | ? | ? | ? | โ VCL | ? |
| Config tests block a bad publish | โ | โ Trace | โ | โ | โ | โ simulator | ? |
| Versions and revert | โ | โ Enterprise | โ | โ | โ | โ | โ |
| Canary of rule changes | โ | โ Enterprise | โ up to 15% | โ | โ | โ not NGWAF | โ |
| Automatic rollback on errors | โ | โ | โ | โ | โ | โ | โ during rollout |
| Audit log | โ | โ | โ | ? | โ | โ | ? |
| Vendor neutral | โ | โ Terraform | โ | โ Terraform | โ | โ Terraform | โ Terraform |
Perimeter¶
The proxy does none of this by design. Keep a vendor in front.
| Capability | Proxy | Cloudflare | AWS | AFD | GCA | Fastly | Akamai |
|---|---|---|---|---|---|---|---|
| OWASP managed rules | โ | โ from Pro | โ | โ Premium | โ | โ by tier | โ |
| Bot management | โ | โ by plan | โ paid | โ Premium | โ | โ add-on | โ add-on |
| Volumetric DDoS | โ | โ | โ | โ | โ | โ | โ |
| Client TLS | โ | โ | โ | โ | โ | โ | โ |
Added latency. Vendors run their rules in the POP the request already reaches. The proxy adds one network hop, plus one pipelined Valkey round trip when a rate-limit rule matches. Its own in-process work on the allow path is about 5 ยตs (BenchmarkAllowPath, no network). On a shared 2 vCPU machine the load tests measured an added p99 of 1.9 to 3.9 ms at 300 RPS.
Where each side wins¶
Vendors:
- The perimeter: OWASP rules, bots, volumetric DDoS, TLS and anycast at global scale.
- Nothing extra to run: no hop, no fleet, no Valkey, no admin service or Postgres.
- Mature change management on some platforms: Akamai's staging network and phased rollout, Fastly's versioned services.
The proxy:
- Exact, shared quotas. Every vendor counts per POP, server or region, and AWS, Cloudflare and Google say not to rely on it for precise limits. "5 logins per minute" means exactly 5 here.
- Limits on verified identity. Only Cloudflare Enterprise with API Shield does this natively.
- Explicit failure behaviour: open, closed or local, chosen per rule.
- An upstream header contract that clients can't spoof, without edge code.
- One policy model across clouds. Moving CDN means changing the trust preset, not rewriting rules.
- Tested changes: a failing config test blocks publish, and the canary and guard roll back degraded policy.
Both: basic IP rate limits with penalties and log-only mode, custom error bodies, static CORS headers, simple header edits and path normalization. If your needs stop there, a vendor alone is simpler and cheaper.
Decision guide¶
| Your situation | Use |
|---|---|
| Public site, approximate limits are fine, one vendor | Vendor only |
| Exact per-user or per-tenant quotas, or limits on verified identity | Vendor in front, plus this proxy |
| Several clouds or CDNs, or a planned migration | Vendor in front, plus this proxy as the portable policy layer |
| Application teams own policy and need tests, canaries and audit | This proxy |
Caveats¶
- Proxy marks are backed by the code; the exact-quota claim by
TestSharedQuotaAcrossEdgesagainst standalone and cluster Valkey. - Akamai's App & API Protector guides need a login, so its marks come from its public API, Terraform and Property Manager references.
- Fastly's JWT, CORS, locale, normalization, versions and TLS marks rest on search summaries rather than a full read of the page.
- Vendor tiers change often. Recheck them before a purchase decision.