Cloudflare

Setting Up Cloudflare with Your Power Down Server

Add Cloudflare's CDN, WAF, and DDoS protection in front of your website — the free tier covers most use cases.

Published Apr 25, 2025Updated Jun 1, 20269 min readBeginner
Table of Contents

Why Use Cloudflare?

Cloudflare acts as a reverse proxy between visitors and your server, providing free CDN caching, DDoS protection, WAF, SSL, and detailed analytics — without any code changes to your application.

Step 1: Create a Cloudflare Account and Add Your Site

  1. Go to cloudflare.com and create a free account
  2. Click Add a Site and enter your domain
  3. Select the Free plan
  4. Cloudflare scans and imports your existing DNS records
  5. Review the imported records — verify A records point to your server IP

Step 2: Update Nameservers at Your Registrar

Cloudflare gives you two nameservers like:

ns1.cloudflare.com
ns2.cloudflare.com

Log in to your domain registrar and replace the existing nameservers with these. Propagation takes 24–48 hours, often much less.

Step 3: Understand the Orange vs Gray Cloud

  • Orange cloud (proxied): Traffic routes through Cloudflare — CDN, DDoS protection, and WAF apply
  • Gray cloud (DNS only): Cloudflare just resolves DNS, traffic goes directly to your server

Enable the orange cloud for your main A records (www, @). Keep MX records gray — email should never be proxied.

SettingWhereRecommended Value
SSL/TLS ModeSSL/TLS → OverviewFull (Strict) — requires valid cert on server
Always HTTPSSSL/TLS → Edge CertificatesOn
HSTSSSL/TLS → Edge CertificatesEnable (max-age: 6 months)
Security LevelSecurity → SettingsMedium
Bot Fight ModeSecurity → BotsOn
Browser Integrity CheckSecurity → SettingsOn

Caching Static Assets

Go to Caching → Configuration:

  • Set Browser Cache TTL to 1 month for static sites
  • Enable Always Online to serve cached pages if your server is down

Purge Cache After Deployment

# Using Cloudflare API
curl -X POST "https://api.cloudflare.com/client/v4/zones/ZONE_ID/purge_cache"   -H "Authorization: Bearer YOUR_API_TOKEN"   -H "Content-Type: application/json"   --data '{"purge_everything":true}'
CloudflareCDNDDoSDNSsecurity
Was this article helpful?

Join Our Discord

Connect with our community of gamers and developers

Get instant support, share experiences, and stay updated with the latest news

Join Us On Discord
2026 VPS SaleLIMITED TIME
View Sale Plans