Pingora
Rust framework to build fast, reliable network services
Pingora is an open-source Rust framework from Cloudflare for building fast, secure, and programmable proxies and network services. It powers a large share of Cloudflare's traffic.
Key features
- Programmable proxy framework
- Memory-safe Rust core
- High performance
- Battle-tested at Cloudflare
Pros & cons
Strengths
- Battle-tested at Cloudflare
- Excellent performance
- Memory-safe Rust
Trade-offs
- Rust coding required
- Not a turnkey proxy
Pingora replaces
Last reviewed Aug 26, 2026 · 840 words
If you want a config file, Pingora is not for you. It is a Rust library, published by Cloudflare, for writing your own proxy. There is no pingora.conf, no docker run, no web UI, and no listing in the proxy category that is a fair comparison, because Caddy, Traefik and Nginx are products and Pingora is a set of crates. The catalogue is blunt about it: Hard, Rust coding required, not turnkey. Everything below is about what a self-hoster actually gets from a framework that serves a large share of Cloudflare's traffic.
What the crates give you
Pingora handles the parts of a proxy that are miserable to get right: an async HTTP/1 and HTTP/2 server and client, TLS via OpenSSL or BoringSSL, connection pooling and reuse to upstreams, load balancing with health checks, zero-downtime upgrades by handing listening sockets to the new process, and a multi-threaded runtime tuned for the work. You supply the logic that decides what to do with each request by implementing a trait, and the framework does the rest. Cloudflare's stated reasons for building it were memory safety, fewer crashes, and far fewer connections to origins than the Nginx-based system it replaced, and those are the same reasons anyone else would use it.
A minimal proxy is about 40 lines
This is roughly what the smallest useful Pingora program looks like, forwarding everything to one upstream:
use async_trait::async_trait;
use pingora::prelude::*;
struct Upstream;
#[async_trait]
impl ProxyHttp for Upstream {
type CTX = ();
fn new_ctx(&self) -> Self::CTX {}
async fn upstream_peer(
&self,
_session: &mut Session,
_ctx: &mut Self::CTX,
) -> Result<Box<HttpPeer>> {
Ok(Box::new(HttpPeer::new(("127.0.0.1", 8080), false, String::new())))
}
}
fn main() {
let mut server = Server::new(None).unwrap();
server.bootstrap();
let mut proxy = http_proxy_service(&server.configuration, Upstream);
proxy.add_tcp("0.0.0.0:6188");
server.add_service(proxy);
server.run_forever();
}
That is the shape of it: a struct, one trait implementation whose methods run at each phase of a request, and a server that owns the listeners. Adding logic means implementing more of the trait's hooks: request_filter to reject or rewrite before contacting the upstream, upstream_request_filter to edit headers, response_filter on the way back, logging at the end. The 128 MB RAM figure in the catalogue is realistic for a binary like this; a compiled Pingora proxy is a few tens of MB resident under real load.
Where it earns its place in a self-hosted stack
I would reach for Pingora in exactly three self-hosting situations. First, a routing rule that a config language cannot express, such as choosing an upstream by inspecting a request body or a database lookup, where Nginx would need Lua and Caddy would need a plugin. Second, a purpose-built gateway sitting in front of a set of internal services where you want custom auth, rate limiting, and metrics in one small binary you fully understand. Third, learning: writing a proxy against a well-designed framework teaches more about HTTP than a year of editing config files.
For the common case, terminating TLS and routing a dozen hostnames to a dozen containers, it is the wrong tool by a wide margin. Caddy does that with automatic certificates in 5 lines; the reverse proxy showdown compares the options that are actually meant for it.
Turnkey proxies built on it are arriving, slowly
Because Pingora is a library, the ecosystem answer is projects that wrap it in a configuration file. The best-known is River, a reverse proxy sponsored by the Internet Security Research Group, which reads a config and exposes Pingora's features without any Rust. Cloudflare itself has released a few sibling crates for load balancing, caching, and rate limiting. As of writing none of these are as complete or as documented as Caddy or HAProxy, and I would not run them in front of anything I care about yet, but the direction is that Pingora becomes the engine under proxies rather than something most people touch directly.
What it is not
It is not faster Nginx for your homelab. It is not a CDN. The name attracts people who read "powers Cloudflare" and expect a product, and the 27,000 stars are largely that curiosity. It is a well-engineered, Apache-2.0-licensed foundation with a real learning curve, and the catalogue's binary-or-source deployment means you are compiling it yourself either way.
What I'd do
Run Caddy for the proxy in front of your services and leave it there. If you have a routing problem Caddy genuinely cannot express, or you want to write a small gateway in Rust and understand every line, clone the Pingora repository, work through the examples directory, and build the 40-line proxy above against a local service. Budget a weekend. Keep it off the internet until you have added request timeouts and a body size limit, which the framework leaves to you.
Compare Pingora
9 head-to-head comparisons.
Similar reverse proxy & gateways apps
Caddy
Reverse Proxy & GatewaysFast, multi-platform web server with automatic HTTPS
Replaces Nginx, Apache
Traefik
Reverse Proxy & GatewaysCloud-native reverse proxy and load balancer
Replaces HAProxy, AWS ELB
Pi-hole
Reverse Proxy & GatewaysBlackhole for Internet advertisements with a GUI for management
Replaces NextDNS
acme.sh
Reverse Proxy & GatewaysPure shell ACME client for TLS certificates
Replaces Certbot
mitmproxy
Reverse Proxy & GatewaysInteractive HTTPS proxy for inspection and debugging
Replaces Charles Proxy, Fiddler
Kong Gateway
Reverse Proxy & GatewaysCloud-native, fast, scalable API gateway
Replaces AWS API Gateway, Apigee