Cloudflare is a caching reverse proxy sitting in front of your origin servers. It makes requests to the origin servers when it receives requests and then caches them primarily based on Cache-Control and legacy Expires headers. It pulls into edge nodes based on what's requested.
Conversation
The caching isn't mandatory. It can sit in front of dynamic services and will cache what it can. Most CDNs have you upload (push) content and you either link to content from your web site or you put the entire web site onto it as a static site, etc. Some services support both.
2
1
They also have other services related to that including load balancing across more than one origin server. You can use the load balancing with their proxy disabled too. You can run code on the edge nodes via Workers to reduce the need to make requests to the origin server, etc.
1
1
Cloudflare started out as being a caching nginx reverse proxy as a service with a network of many edge nodes using anycast IPs to route traffic to nearest edge node, and from there to your origin server(s) for anything that wasn't cached. They diverged from nginx though.
2
1
They still use a substantially modified fork of nginx which has diverged more and more and does much more. They use multiple types of nginx instances of it on every node. Substantially different from upstream project and they're gradually replacing it with homegrown stuff.
1
1
nginx's own caching reverse proxy support and other features are far more primitive and they gradually replaced almost all of it with their own code to the point that it's not really nginx anymore. They tried to upstream a bit but it mostly didn't go anywhere and it's too late.
1
A problem with nginx as an open source project is they have an open core model where a bunch of important and even very basic features are part of NGINX Plus instead of open source nginx. Simple example: nginx permanently caches DNS result for each host entry in upstream blocks.
2
1
I'll believe it when I see it. Their business model is at odds with an open source project accepting contributions, since they get their money from implementing features based on contract work and selling access to features exclusively available in NGINX Plus. Doesn't mix well.
2
1
Saying that as someone who heavily uses it. All our web services for use nginx and we also use it in front of non-web servers as a TCP/UDP proxy in some cases. There isn't really a great alternative but... all it takes is a fork without artificial limits.
Look at dashboard at demo.nginx.com. That's based on an API entirely part of NGINX Plus. Here's 100% of monitoring you get with open source nginx:
Active connections: 291
server accepts handled requests
16630948 16630948 31070465
Reading: 6 Writing: 179 Waiting: 106

