Riffing on Nginx Playground
Dmitry Ilyevsky
We’ve been working with Envoy Proxy a lot and when we first learned about Julia Evans’ Nginx Playground we though it would be cool to build a similar playground for Envoy too. Envoy is an incredibly powerful L4/L7 proxy but the flip side is that writing configs for it really is a pain (we’d argue even more so than Nginx).
Since Julia open-sourced Nginx Playground recently, we thought we’d give it a shot. We figured it would be pretty easy to fork Nginx Playground and convert it to Envoy. And so it begins:
First, the “hard” part git clone
https://github.com/jvns/nginx-playground/
sed s/nginx/envoy/
Next, try to compile it, fail - try again.
Remember that func-e is awesome and built to vendor and run Envoy quicly.
Doh. func-e is unable to download binary from the bubblewrap sandbox.
Vendor func-e in the Docker image.
Realize that the Envoy team for some reason suffixed the binary with aarch_64
instead of aarch64
so fix that.
On to the UI - run sed again.
Fix a bug in CodeMirror and upstream the fix.
Serve UI assets directly from Go using http.FileServer so that everything could be run from one process.
Ship it.
Deploy to Fly via flyctl launch
which builds and starts the Docker container automatically!
CNAME envoy-playground.apoxy.dev
to envoy-playground.fly.dev
Create the TLS certificate with flyctl certs create envoy-playground.apoxy.dev
Done! It’s live!