Skip to content
Impulse SoftwareDOCS
Get modules

ImpulsePlesk

Verified for ImpulsePlesk 1.9.2 ·

Cloudflare protection

The Cloudflare tab lets a customer put their site behind Cloudflare without leaving your client area, in one of two ways: protection you manage, from one Cloudflare account and one edge zone of yours, so the customer signs up for nothing and their DNS stays on your nameservers; or their own Cloudflare account, for a customer whose DNS already lives at Cloudflare. Either way the server’s address stays out of sight, and an origin lock turns the server into a wall for anyone who finds it anyway. This page covers what you set up, what the customer sees, and how it behaves.

Requirement Where
The file service, 1.5.0 or later, on each server (1.7.0 for the protection you manage) It installs and runs the tunnel connector, and writes the site configuration for the lock and the www redirect.
The connector on each server Operations → Cloudflare Tunnel → Connector on each server → Install connector: the cloudflared package from Cloudflare’s repository, under its own system user.
Plan flag Cloudflare Tunnel Plans & Products: the tab shows only on plans with the box ticked. Its Max tunnel hostnames (default 5) caps the hostnames a customer may protect.
One of the two offers switched on Offer Cloudflare protection to customers (managed by you) and/or Customers may connect Cloudflare Tunnel, both under Operations → Cloudflare Tunnel and both off by default.

Customer domains stay on your nameservers for the protection you manage: the module rewrites their records in Plesk’s DNS. A customer who brings their own Cloudflare account needs that domain’s DNS at Cloudflare already.

Once, in Cloudflare:

  1. Add a domain of its own to your Cloudflare account as the edge zone (its nameservers at Cloudflare). A dedicated domain is cleanest; customers never see it.
  2. Enable Cloudflare for SaaS on that zone under SSL/TLS → Custom Hostnames. Cloudflare includes 100 custom hostnames and bills the rest per hostname on your Cloudflare account.
  3. Create an API token under My Profile → API Tokens with Zone › SSL and Certificates › Edit, Zone › DNS › Edit and Account › Cloudflare Tunnel › Edit, scoped to the edge zone.

Then in ImpulsePlesk → Operations → Cloudflare Tunnel:

  1. Under Your Cloudflare, tick Offer Cloudflare protection to customers (managed by you), paste the API token, enter the Edge zone and click Save and verify. The page reports Zone … verified. Cloudflare for SaaS is enabled (fallback origin …), or says what is missing (enable it on the zone under SSL/TLS → Custom Hostnames).
  2. Under Connector on each server, Install connector on every server that will carry protected sites.
  3. Under Each server, click Set up on each. It creates the server’s tunnel into the edge zone and its origin record, starts the connector, and the first time sets the zone’s target record and fallback origin. Check now shows the connector’s connections; Remove takes a server out again, and is refused while a customer site still uses it.

Protected customer hostnames, further down the page, is your view of every protected site: its status, whether it is locked (Only through Cloudflare, Open — not locked) and when it was last checked.

The tab leads with Protect your site with Cloudflare: nothing to sign up for, DNS stays here, attackers who find the server’s address get a 403 once the shield is on. The customer picks the Hostnames to protect (every site on the subscription and its www. form, the primary and its www ticked by default) and clicks Protect my site. Behind it, the module creates one Cloudflare custom hostname per name, swaps that name’s records in Plesk DNS for a single CNAME to the edge zone (keeping the old records to put back), and tells each site to take the visitor’s address from Cloudflare. If any step fails, everything made so far is undone.

  • A bare domain is never protected directly — Cloudflare proxies an apex only on its Enterprise plan. Picking one adds its www. form, and the site gets a redirect from the bare domain to https://www.… ahead of the lock. The row says sent to www.… — a bare domain can’t go through Cloudflare on our DNS.
  • Protection takes a few minutes: Cloudflare checks the DNS change and issues a certificate. The card shows Setting up: DNS, then Setting up: certificate, then Active; Check now refreshes it, and the module’s health check runs every 15 minutes.
  • Add hostname and Remove change the protected set later. Turn off protection puts every DNS record back the way it was and removes the custom hostnames; the server’s tunnel stays for other customers.

Many WordPress sites have their address set to the bare domain and send www visitors there — which would send them straight back out of Cloudflare. The tab checks this before the click and, when it finds it, shows an amber note starting Before you can protect this site: and disables Protect my site until the address is fixed. When the site is a WordPress site the WordPress Toolkit knows, the note offers a one-click fix: Switch my site’s address to www.…. It changes both of WordPress’s address fields through the toolkit, keeps http or https as it was, flushes the site’s cache and checks again — Done — your site’s address is now …. You can protect it now. It changes nothing in DNS or in Plesk, and nothing in the site’s stored content. A caching plugin that keeps the old address is named as the likely cause when the check still fails.

3. The customer’s own Cloudflare account

Section titled “3. The customer’s own Cloudflare account”

With Customers may connect Cloudflare Tunnel on, the tab offers (or, when you also offer managed protection, folds under Use your own Cloudflare account instead) two ways in:

  • Connect with an API token — the customer creates a token with Account › Cloudflare Tunnel › Edit and Zone › DNS › Edit, pastes it, ticks the Hostnames through the tunnel, and clicks Connect Cloudflare. The module finds each hostname’s zone, creates a tunnel in the customer’s account, points the hostnames at it (keeping the replaced records), starts the connector on the server and sets the site to trust Cloudflare’s visitor address. Hostnames across two Cloudflare accounts are refused; so is a hostname whose zone the token can’t see.
  • Use a tunnel token — for a customer who manages hostnames in their own Cloudflare dashboard: they create the tunnel there, paste its Tunnel token, and the tab shows the service settings to enter at Cloudflare (HTTPS to the server’s address on port 443, the origin server name, No TLS verify on). The connector runs here; the public hostnames are theirs to manage.

Check now and Disconnect are on the status card; a From Cloudflare card shows the tunnel’s health, connections, edge locations and connector version as Cloudflare reports them. Disconnecting an API-token tunnel deletes the tunnel from the customer’s account and puts their DNS back; a tunnel-token customer is told to remove the dashboard hostnames themselves. While a domain goes through a customer’s own Cloudflare, the DNS tab says so and offers Open Cloudflare DNS.

Connected is not yet protected: the site still answers anyone who reaches the server directly. Only reachable through Cloudflare — offered while Customers may make a site reachable only through Cloudflare is on (the default) — makes the chosen sites refuse every visitor that didn’t come through the tunnel with a 403, while their real addresses still reach the site’s logs and applications. Turn on (recommended) is available once the tunnel shows Connected; Update sites changes the set; a separate Turn off the lock form asks its own question and leaves the protection or tunnel in place.

On the server, the module writes a marked block into the site’s web-server configuration and asks Plesk to reconfigure the domain, rolling back if the web server refuses. The bare-domain redirect sits ahead of the lock. If the connector goes down while the lock is on, the card says so and tells the customer to turn the lock off until the tunnel is back.

  • The tunnel health cron checks every tunnel every 15 minutes. After two failed checks in a row it raises an alert — critical when the lock is on — and emails the customer once per outage with the Managed Web Hosting - Cloudflare Tunnel Disconnected template. A server tunnel of yours that goes down raises a critical alert for you.
  • Keep the connector up to date (on by default) upgrades cloudflared on every server once a day; a new release restarts that server’s connectors, which reconnect within seconds. With it off, use Upgrade now under Connector on each server.
  • Changes are recorded in ImpulseCore’s audit log for the module: tunnel.connected, tunnel.disconnected, tunnel.lock_on, tunnel.lock_off, tunnel.down, tunnel.wp_address; for the protection you manage, cfm.protected, cfm.unprotected, cfm.server_set_up, cfm.server_removed and cfm.server_down; and tunnel.connector_missing when a customer tried to connect on a server without a connector (the customer is told the support team knows).