cloudflare quick tunnel / trycloudflare not getting requests from local dev server
Hi, this issue is plaqueing me now for almost 2 hours.
Im on mac os, latest version of cloudflared. i run these 2 commands:
on macOs, zsh.
in my browsers localhost:8000 works just fine and serves index.html
however from cloudflare tunnel i only get 404 Not found, but not from my local server but rather the cloudflared tunnel.
am i missing something obvious? In my opinion, when i run the second command i should just get everything that runs on localhost:8000 but via the dynamically generated domain.
30 Replies
Could you retry this with the macos firewall disabled? Are you seeing a CF tunnel 404 or your webserver's 404?
i see this 🙂 logs of cloudflared say 404 but the python3 -m http.server 404 has different styling.
so the request gets to my computer cloudflared just somehow can't find localhost:8000?
tried with different ports etc.
firewall off, restarted both services, no change. :/
index.html in not empty right?
nope, but even if it was/incorrect path still would show a different error message. i can access localhost:8000 from every browser on my ~pc~ mac
have you tried the full cloudflared url /index.html (including path)
grab response headers
this is request to index.html
cf-cache-status existing means it went down the tunnel
yep when i run the quick tunnel with debug, i can see it as a 404 on my machine
tunnel might not have routed it right but it did get that far at least
hmm what exactly did the debug info show?
this is not valid anymore, but something like this (from an hour ago):
ingressRule=1 originService=http_status:404 path=/it didn't match any ingress rule/use your --url
it's not even trying to connect to your origin.
http_status:404
is a special tunnel handled url that just returns a 404
I'll see if I can repro in a second. Otherwise I would try updating cloudflared. Using a proper named tunnel is also an optioni updated it in hopes for that issue to be fixed, like an hour ago
version 2024.9.1
What's the full output you get when starting up a quick tunnel (censoring any private ip info)?
I'm thinking you have a configuration it's picking up
[config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
ahh that might be, could be years ago ^^
is there something like '--ignoreconfig'
😄
no but you could just..delete it. On startup it should tell you if it can find a config or not
hmm i dont see that it uses any config, a search i didn't find any config files (config.yaml)
What's the full output of the startup?
yea looks like it found a config otherwise it'd say
2024-10-04T15:45:59Z INF Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
ahhh
ok thanks, so i need to find it
probably under
/Users/tobi/.cloudflared/
?
maybe debug level showsahahhhh thank you very much 🙂 yes
that was it, thanks 🙂
weird that --url doesn't override but I guess it probably is ignored when a config is there or appends itself to the end after the typical 404 fallback
yeah :/ i completely disregarded the warning about config in the docs because i thought i overrode with quick tunnel anyways