Cloudflare works well in front of a Gen2 server. The server already knows Cloudflare's addresses and reads the visitor's real IP address, so limits, blocks and logs keep working per visitor.
- DNS
Create the A records for
@andwwwwith the server's IPv4 address. Proxy (orange cloud) can be on. - SSL/TLS modeFull (strict). Never Flexible: it causes redirect loops and sends traffic unencrypted to the server.
- Always Use HTTPS
On.
- Caching
Leave HTML to the server (Varnish or Magento's page cache). Let Cloudflare cache images, CSS and JavaScript.
- Under Attack mode
Only during a real attack; the server's own browser check usually handles bot waves without bothering customers.
If you restrict access to the server to Cloudflare only, keep our platform and your SSH addresses allowed, or you lose console actions that reach the site.
Manage Cloudflare from the console
Each application has a Cloudflare tab. Connect your zone once with an API token of your own and change the basics without leaving the console:
- Development mode, SSL mode, Always Use HTTPS, minimum TLS and HTTP/3.
- Security level, including I'm Under Attack for the worst moments.
- Caching level and browser cache TTL.
- Purge everything, or only some URLs.
- The orange cloud (proxy) of the application's DNS records, with a warning when a record points elsewhere.
Connecting takes about two minutes: see the step by step guide Connect Cloudflare to the console.
Purge after changes
After a design change, flush the store's caches first, then purge Cloudflare's cache (Cloudflare tab, Purge everything).
Did this solve it? If not, tell us what you see and we look at your server.
Open a ticket