Cloudflare
Published
Updated
☁️
Domains, CDN, DNS and DDOS protection.
Cloudflare runs DNS and a proxy in front of a fortrabbit environment, for DDoS protection and caching. Set the SSL/TLS mode to Full, and allow only Cloudflare addresses to keep traffic from bypassing it.
About Cloudflare
Cloudflare runs DNS and a proxy in front of websites. It caches content like a CDN and filters attacks, including DDoS.
Pricing and signup
Cloudflare has a free plan, see Cloudflare plans.
Integrating Cloudflare with fortrabbit
Cloudflare and fortrabbit have no direct connection. The name servers of the domain point to Cloudflare, which answers DNS and proxies the requests to fortrabbit.
Setup Cloudflare
- Add the domain to the environment in the fortrabbit dashboard.
- Point it to fortrabbit at the current DNS provider, see the external domain setup.
- Add the domain to Cloudflare, which imports the existing records.
- Switch the name servers of the domain to Cloudflare at the registrar.
For a domain registered with Cloudflare, enter the records from the fortrabbit dashboard in Cloudflare directly.
SSL/TLS encryption mode
The SSL/TLS settings of Cloudflare set how Cloudflare connects to fortrabbit. The visitor to Cloudflare is encrypted either way, the connection from Cloudflare to fortrabbit depends on the mode:
┌──────┐ ┌────────────┐ ┌────────────┐
│ User ├─HTTPS─▶ Cloudflare ├─ ? HTTPS ? ─▶ fortrabbit │
└──────┘ └────────────┘ └────────────┘
Set the mode to Full. fortrabbit serves the domain over HTTPS, so the whole way is encrypted. Flexible connects to fortrabbit over plain HTTP, which fortrabbit redirects to HTTPS, so the browser ends in a redirect loop.
Keep /.well-known/ open
fortrabbit serves a domain and issues its certificate only after a request to /.well-known/fortrabbit reaches the environment. Cloudflare's defaults and Bot Fight Mode pass it.
A custom rule that challenges or blocks /.well-known/ keeps the domain pending. Exempt the path with a Skip rule under Security → Security rules.
Advanced topics
Domain status in the dashboard
With the Cloudflare proxy on, DNS returns Cloudflare addresses instead of the records for fortrabbit. The dashboard recognizes them and shows "DNS points to Cloudflare" instead of checking the records.
Certificates without Cloudflare
fortrabbit provides free TLS certificates for every domain. Cloudflare is not needed for HTTPS.
Cloudflare and 2nd level subdomains
The free Cloudflare certificate covers the domain and one level of subdomains. A deeper subdomain like dev.www.example.com fails with SSL_ERROR_NO_CYPHER_OVERLAP, see Cloudflare SSL troubleshooting.
Other reasons to use Cloudflare
- DDoS protection and bot filtering
- CNAME Flattening for apex domains
- Caching of static files close to the visitor
Prevent direct access
DDoS protection only holds when nothing reaches fortrabbit around Cloudflare, including the default domain. Allow only the Cloudflare addresses in .htaccess. fortrabbit passes the visitor address to Apache, here the Cloudflare one. Check the ranges against cloudflare.com/ips from time to time; this list is from October 2026:
ErrorDocument 403 "Not Allowed"
<RequireAny>
Require ip 173.245.48.0/20
Require ip 103.21.244.0/22
Require ip 103.22.200.0/22
Require ip 103.31.4.0/22
Require ip 141.101.64.0/18
Require ip 108.162.192.0/18
Require ip 190.93.240.0/20
Require ip 188.114.96.0/20
Require ip 197.234.240.0/22
Require ip 198.41.128.0/17
Require ip 162.158.0.0/15
Require ip 104.16.0.0/13
Require ip 104.24.0.0/14
Require ip 172.64.0.0/13
Require ip 131.0.72.0/22
Require ip 2400:cb00::/32
Require ip 2606:4700::/32
Require ip 2803:f800::/32
Require ip 2405:b500::/32
Require ip 2405:8100::/32
Require ip 2a06:98c0::/29
Require ip 2c0f:f248::/32
</RequireAny>
Alternatives to Cloudflare
Cloudflare bundles DNS, proxy and CDN, and the website depends on all of them. Some clients prefer separate services for DNS and CDN.