The 5-hour CDN

A bunch of you all are running ngnix in front of your apps. Here’s an article about it, with a suggestive last line: “an application designed for edge distribution may not need a CDN at all.”

3 Likes

Awesome writeup!

I was exploring the nginx-cluster repo and in the fly.toml I noticed that you have the http handlers turned on.

Is this necessary? What benefit does it provide compared to allowing the connection to go straight to the Nginx server? It looks like Nginx has support for h2c so I would have thought it unnecessary for the http handler.

EDIT: never mind, after more research I found out that while Nginx supports h2c, it doesn’t support upgrading from HTTP/1.1 to HTTP/2.

2 Likes

There’s actually a more nuanced answer, specific to us:

The HTTP handler enabled two features:

  1. http2. If you turn it off, we don’t send the right ALPN information to allow h2 connections through.
  2. Connection pooling: nginx doesn’t like connection churn, when apps use the HTTP handler we can keep a pool of connections to nginx open and keep it happier.