Cloudflare Free: Make Your Domain Legit, Fast & Secure — A Practical Checklist
What you get for $0 (high‑impact highlights)
• Authoritative DNS with global anycast
• Universal SSL/TLS certificates (DV), Auto-renew
• CDN caching + Brotli/Gzip compression
• DDoS mitigation (L3/4/7) when proxied (orange cloud)
• HTTP/2 and HTTP/3 (QUIC) support
• WAF Managed Rules (free ruleset) + basic firewall
• Bot Fight Mode (basic bot protection)
• Bulk & Single Redirects (for www→apex, legacy URLs)
• Email Routing (free inbound forwarding) + DMARC Management
• DNSSEC (sign your zone)
• Transform Rules (add security headers)
Step‑by‑step setup (15–30 minutes)
1) Add your domain → change nameservers at your registrar to Cloudflare’s.
2) Proxy only web traffic you want protected/accelerated (orange cloud). Leave mail-related DNS records (MX, mail.) unproxied (gray cloud).
3) Enable DNSSEC → copy DS record into your registrar.
4) SSL/TLS → set mode to “Full (strict)” after you install a valid cert on origin (or use Cloudflare Origin CA).
5) Edge certificates → Universal SSL ON.
6) Enforce HTTPS → Always Use HTTPS ON + Automatic HTTPS Rewrites ON. (Fix mixed content if any.)
7) HSTS → enable only after your site is 100% HTTPS; start at max‑age=1 day, then increase.
8) Protocols → enable HTTP/3 (QUIC).
9) Performance → enable Brotli compression (default), and default CDN caching. Consider simple Cache Rules later.
10) Redirects → configure www→apex (or vice versa) and any old URL patterns using Single Redirects or Bulk Redirects.
11) Security → turn on WAF Managed Rules and Bot Fight Mode.
12) Email → set up Email Routing for hello@yourdomain → your inbox, add SPF/DKIM/DMARC (and enable DMARC Management).
13) Headers → add or verify security headers via Transform Rules (see examples).
Minimum viable security settings (safe defaults)
• SSL/TLS: Full (strict)
• Always Use HTTPS: ON
• Automatic HTTPS Rewrites: ON
• HTTP/3 (QUIC): ON
• WAF → Managed Rules: ON (Cloudflare Managed Ruleset + Free Managed Ruleset)
• Bot Fight Mode: ON (monitor for false positives)
• DNSSEC: ON
• HSTS: start low (e.g., 1 day), includeSubDomains=off initially
Performance basics (no knobs required)
• CDN caching on by default for static assets
• Brotli/Gzip compression automatically applied
• HTTP/2/3 multiplexing and connection reuse
Redirect recipes
A. Force www → apex (or the reverse) with a Single Redirect rule.
B. Bulk legacy URLs → use Bulk Redirects via a list (CSV import available).
# Example (Bulk Redirects list CSV)
source_url,target_url,status
https://old.example.com/blog/(.*),https://example.com/blog/$1,301
https://example.com/old-doc,https://example.com/new-doc,301
Note: use wildcards with Single Redirects; use lists for many static mappings.
Add security headers with Transform Rules
# Response header transforms (examples)
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
Referrer-Policy: no-referrer-when-downgrade
Permissions-Policy: camera=(), microphone=(), geolocation=()
Tip: test HSTS carefully; once preloaded, rollbacks are slow.
Turnstile (free CAPTCHA replacement)
Protect forms/logins without messing up UX. Two‑minute setup:
<!-- HTML -->
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<form action="/signup" method="POST">
<div class="cf-turnstile" data-sitekey="YOUR_SITE_KEY"></div>
<button>Sign up</button>
</form>
// Server (pseudo):
// verify response token by POSTing to https://challenges.cloudflare.com/turnstile/v0/siteverify
Email: forwarding + authentication
• Email Routing: create hello@yourdomain and forward to your real inbox.
• Add SPF (TXT), DKIM (from your sending provider), and DMARC (TXT). Enable DMARC Management to visualize reports.
• If you do not send mail from the domain, publish a “reject all” DMARC policy.
WAF & Bot protection quick start
• Security → WAF → enable Cloudflare Managed Ruleset (and Free Managed Ruleset) in Block or Challenge.
• Security → Bots → enable Bot Fight Mode. If you see issues, reduce to “Managed Challenge” or add exceptions.
Verifying it works
• SSL: visit https://yourdomain — certificate should be issued by Cloudflare.
• HTTP/3: check DevTools → Protocol h3 (or use curl: curl -I --http3 https://yourdomain).
• Redirects: try http://www.yourdomain → should 301 to HTTPS canonical.
• DNSSEC: use a DNS checker to confirm DS records propagate.
• Security: Cloudflare dashboard → Security → Events (watch WAF/Bot actions).
Common footguns
• Using “Flexible” SSL mode (don’t) — enables HTTPS to users but HTTP to your origin; use Full (strict).
• Proxying mail (MX/IMAP/SMTP) — leave mail hostnames unproxied (gray cloud).
• Turning on HSTS before your site is fully HTTPS.
• Breaking APIs with over‑aggressive WAF rules — start in Log/Simulate, then tighten.
Appendix: One‑time origin cert (if you lack a valid cert)
Cloudflare → SSL/TLS → Origin Server → Create certificate → Install on your origin → Set SSL mode to Full (strict).
Taylor Swift
“I keep my side of the street clean.”
Comments
Post a Comment