Cloudflare Tunnel doesn't work with wildcards #2926
-
I have an issue where I tried to set up Cloudflare Tunnels to work on my server I have options *.domain.com -> localhost:8000 In the coolify page Settings -> General -> Configuration -> Instance's Domain => coolify.domain.com And somehow I can connect to coolify.domain.com and I managed to attach a private repository, but when I try to run an app in generated url, I see DNS_PROBE_FINISHED_NXDOMAIN I tried to add a new server because there's a button called "Cloudflare Tunnels" but I need to validate the server and I can't, I tried "localhost", "127.0.0.1" and "host.docker.internal". All the time I get an error "Server is not reachable" If you need extra information about the problem, please let me know and I'll try to answer as much as possible |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 7 replies
-
Got the same issue |
Beta Was this translation helpful? Give feedback.
-
Any update on this? Have you guys managed to get it working? I followed this setup https://coolify.io/docs/knowledge-base/cloudflare/tunnels and later even https://coolify.io/docs/knowledge-base/traefik/wildcard-certificates, but there was no luck getting it to work. |
Beta Was this translation helpful? Give feedback.
-
I managed to get it working after all 🥳 . Setup cloudflare tunnelFollow docs but only part for wildcard domains -> https://coolify.io/docs/knowledge-base/cloudflare/tunnels/ Make sure you have DNS setup as follows: Also make sure that SSL is on Full, or Full(Strict) on Cloudflare. Coolify setupYou now need to run cloudflared tunnel locally. services:
cloudflared:
container_name: cloudflare-tunnel
image: 'cloudflare/cloudflared:latest'
restart: unless-stopped
command: 'tunnel --no-autoupdate run'
environment:
- 'TUNNEL_TOKEN=${CLOUDFLARE_TUNNEL_TOKEN}'
networks:
- coolify
networks:
coolify:
external: true Now your cloudflared tunnel can access coolify-proxy and therefore forward requests there. Make sure proxy is actually running Setup domains to http - important!This was step I missed. It's important that you setup your domains from services you're exposing to http://. Like the docs say:
In the server wildcard domain you can actually use http as well so you get new services domains generated with http. |
Beta Was this translation helpful? Give feedback.
-
@mrados7 the reason why localhost wasn't working for you is because , you do not have network_mode : host for cloudflared in your docker compose. FYI there is a coolify template for cloudflared with this already setup. |
Beta Was this translation helpful? Give feedback.
-
@mrados7 Why coolify-proxy:80? I still don't get is xD |
Beta Was this translation helpful? Give feedback.
-
Hey guys, So I got my coolify working with cloudflared in a separate docker container But I have a big problem. For all my resources, only http endpoints work; https endpoints can't be reached. I have my CloudFlare SSL/TLS set to Full, and I also tried Full (strict), but same result. More details here Update: it worked actually, but for osme reason, Brave browser, even if I used incognito, cached the 'can't be reached' response forever. It worked using other browser :) |
Beta Was this translation helpful? Give feedback.
I managed to get it working after all 🥳 .
First if you did a lot of changes to your coolify (specially proxy and containers) I would suggest to do cleanup and start over (here's how).
Setup cloudflare tunnel
Follow docs but only part for wildcard domains -> https://coolify.io/docs/knowledge-base/cloudflare/tunnels/
Instead of putting cloudflare tunnel to localhost:80 I put it on coolify-proxy:80 (you will see why below)
So every request coming from tunnel will come to reverse proxy (by default traefik running on port 80 with container name coolify-proxy)
Make sure you have DNS setup as follows:
Also make sure that SSL is on Full, or Full(Strict) on Cloudflare.
Coolify setup
You now need…