If you're using Cloudflare Tunnel with MultiPortal and Caddyserver, there's one key adjustment you need to make for everything to work seamlessly.
Caddyserver Configuration: To ensure compatibility with Cloudflare Tunnel, you need to configure your Caddyfile to use HTTP mode, not HTTPS.
This is because Cloudflare Tunnel handles the HTTPS termination externally, so Caddy doesn't need to manage SSL in this setup.
Open your Caddyfile for editing.
The Caddyfile is typically located in /etc/caddy/Caddyfile
or another configured directory in your system.
Set the site block to HTTP mode by adding http://
.
Example configuration:
http://YOUR_HOSTNAME {
@css path *.css
header @css Content-Type text/css
root * /var/www/YOUR_HOSTNAME/backend/web
encode gzip
file_server
php_fastcgi unix//var/run/php/php8.2-fpm.sock {
index index.php
}
....
YOUR_HOSTNAME
with the domain or subdomain you're using for your MultiPortal setup.Save the changes and restart Caddy to apply the configuration:
sudo systemctl restart caddy
Once your Caddyfile is updated and the server restarted:
That's it! This simple configuration ensures compatibility between Cloudflare Tunnel, Caddyserver, and MultiPortal.