When deploying multiple WordPress sites on an internal network while sharing a single Cloudflare Tunnel, you can configure it correctly as follows:
-
Set up virtual hosts on the server
Configure virtual hosts on your server so that multiple domains (assume two domains here) share port 80 to publish websites externally. -
Configure the Cloudflare Tunnel
Log in to the Cloudflare dashboard. From the left menu, go to Zero Trust → Networking → Connectors, select the tunnel you previously created, and choose to migrate and host the tunnel on Cloudflare’s cloud (this step is irreversible).
Scroll the screen to the right 👉, click the three dots, then select Configurer → Published application routes from the top menu.Here, add a new application (domain):
-
Subdomain: enter your desired subdomain prefix
-
Domain: select your root domain
-
Type: choose
HTTP -
URL: enter your internal IP address followed by port 80 (for example,
192.168.1.10:80)
Save the configuration. Cloudflare will automatically add a new subdomain under your domain. This subdomain will share the same CNAME as the first subdomain you configured when setting up the tunnel.
In some special cases, Cloudflare does not broadcast this newly added subdomain to the public internet, which causes the DNS record to remain inactive for a long time. If this happens, you need to manually delete the DNS record and then recreate it with the same settings.
At this point, the second subdomain is successfully connected to your internal server via the tunnel. When you access this subdomain in a browser, it will map to the corresponding virtual host published on your internal network.
-
WordPress Editor Issues Behind Cloudflare Tunnel
If the site you published is running WordPress and you find that the Gutenberg editor’s Class Editor cannot be used, or that you have installed the WordPress Classic Editor plugin but see no editor icons on the post edit screen, and the post content does not load properly in the editor, this is usually caused by Cloudflare.
Specifically, Cloudflare’s security filtering, performance optimization scripts, or header/protocol conflicts may block the JavaScript or AJAX requests required by the editor. This results in WordPress admin pages failing to display mixed content correctly.
Cloudflare Tunnel typically provides HTTPS on the frontend, while your local backend may still be using HTTP. This mismatch causes the browser to block editor scripts.
Fix
To fix this issue, simply modify wp-config.php.
Add the following code at the very beginning of the file to force WordPress to recognize the HTTPS status:
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['HTTPS'] = 'on';
}