"Proxy through Cloudflare" is the most generally useful infrastructure trick on the internet. You hand DNS to Cloudflare. Cloudflare answers requests, terminates TLS, caches static assets, blocks bad traffic, and forwards the rest to your real server — for free.
The default mental model of a website on the open internet is: DNS resolves to your server, the user's browser connects directly to your server, your server returns the response. This works fine. It also means your server bears every request — every bot scan, every attempted exploit, every cached asset request from a user who just refreshed. Bandwidth, CPU, and attention all flow at you directly.
A reverse proxy in front changes that geometry. The user connects to the proxy. The proxy decides whether to answer from its own cache, forward to your origin server, or refuse the request entirely. Your origin server only sees the requests the proxy decides to send. This is a familiar pattern in enterprise infra ($$$, lots of vendors), but the version that matters for indie developers is Cloudflare's free tier — which provides exactly this for any domain you have, at no cost.
The benefits compound. Free TLS termination means you don't run Let's Encrypt yourself. Global edge caching means static assets load from a server near each user. Basic DDoS protection means a small-scale attack doesn't take you down. Hidden origin IP means scanners can't trivially find your server. None of it is magic — it's the standard reverse-proxy benefits with the price set to zero.
The data flow with Cloudflare in front:
User → Cloudflare edge → Your origin server
(terminates TLS,
caches static,
filters traffic)
You add your domain to Cloudflare. Cloudflare gives you new nameservers (NSx.cloudflare.com). You change your nameservers at your registrar to point at Cloudflare's. Cloudflare becomes authoritative for your DNS — and gets the opportunity to proxy any record you mark for proxying.
This works regardless of where you bought the domain. Namecheap, Porkbun, GoDaddy — all of them let you set custom nameservers. The exception is Cloudflare Registrar itself, where it's all already wired up.
Sign up at cloudflare.com (the free tier is enough; "Pro" and above are for businesses with specific needs). Click Add a Site, type your domain, pick the Free plan.
Cloudflare scans your current DNS — whatever's authoritative right now — and imports the existing records. Review the imported list. Anything missing, add manually. The records you don't proxy (DKIM, SPF, custom MX) just route DNS as before; the records you do proxy (your main A or CNAME for the website) get the orange-cloud treatment.
Cloudflare gives you two nameserver hostnames (e.g., katie.ns.cloudflare.com and logan.ns.cloudflare.com). At your registrar, find the nameserver settings (every registrar has them) and replace your current nameservers with Cloudflare's two.
Propagation takes minutes to hours — Cloudflare polls and emails you when it sees your domain pointed at them. Until then, both DNS providers are serving records (your old one for resolvers that haven't updated, Cloudflare for ones that have). Make sure your records at Cloudflare match what was there before, or some users will hit the wrong place.
dig @logan.ns.cloudflare.com yourdomain.com) to confirm Cloudflare returns the records you expect. Catching a typo before propagation starts saves you a stressed-out hour.
In Cloudflare's DNS panel, each record has an icon next to it: an orange cloud (Proxied) or a gray cloud (DNS only).
Cloudflare's proxy supports HTTP/HTTPS only. Don't proxy a record that points at SSH or a database; gray-cloud it.
Under SSL/TLS → Overview, Cloudflare offers four modes for the connection from Cloudflare to your origin:
To use Full (Strict), your origin needs a real TLS cert too — either from Let's Encrypt, or use a free Cloudflare Origin Certificate (Cloudflare → SSL/TLS → Origin Server → Create Certificate). The Origin Certificate is valid for up to 15 years and is trusted only by Cloudflare, not the public — perfect for the Cloudflare-to-origin leg.
None of these require configuration to activate — they're on by default the moment the record is orange-clouded.