Flarum (Cloudflare Tunnels not working)

Hey there!

Cloudflare tunnels seem to not be functioning properly with Flarum for some reason, however, it works when an A record is pointing to the server’s IP address & DNS only set (Haven’t tested with CF proxy on). Basically, the tunnel is going to the first host on NGINX rather than the actual one.

PHP Version: 8.0
Webserver: NGINX
Operating System: Ubuntu 22.04 LTS

Flarum is the only app that isn’t working that I’ve been testing so far, a simple HTML file works just fine.

Thanks in advance.

Do you have an example of your Tunnels & NGINX configs?

Tunnel config is correct & so is NGINX config I believe, this issue is occurring from what I think is both software creating a conflict with each other somehow, it works DNS only, so the only thing I can think of is that this is an issue with tunnels.

As for config, NGINX config is similar for both apps & can be found at server { listen 80; server_name domain; return 301 https://$server_name - Pastebin.com

As for the tunnel config, both public hostnames are as follows:

Service: https://localhost (Local cert exists)
noTLSVerify enabled

Are curl https://localhost --header "Host: domain1.com" & curl https://localhost --header "Host: domain2.com" returning the correct, different sites that you’d expect?

Yep & DNS only works fine as well

And your cloudflared config is like this?

tunnel: <uuid>
credentials-file: /<path>/<uuid>.json

ingress:
  - hostname: domain1.com
    service: https://localhost
  - hostname: domain2.com
    service: https://localhost
  - service: http_status:404

Correct

Has noTLSVerify enabled as well