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:
python3 -m http.server

cloudflared tunnel --url http://localhost:8000
python3 -m http.server

cloudflared tunnel --url http://localhost:8000
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
MDev
MDev•2mo ago
Could you retry this with the macos firewall disabled? Are you seeing a CF tunnel 404 or your webserver's 404?
tobi
tobiOP•2mo ago
i see this 🙂 logs of cloudflared say 404 but the python3 -m http.server 404 has different styling.
No description
tobi
tobiOP•2mo ago
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. :/
MDev
MDev•2mo ago
index.html in not empty right?
tobi
tobiOP•2mo ago
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
MDev
MDev•2mo ago
have you tried the full cloudflared url /index.html (including path)
Chaika
Chaika•2mo ago
grab response headers
tobi
tobiOP•2mo ago
No description
tobi
tobiOP•2mo ago
this is request to index.html
Chaika
Chaika•2mo ago
cf-cache-status existing means it went down the tunnel
tobi
tobiOP•2mo ago
yep when i run the quick tunnel with debug, i can see it as a 404 on my machine
Chaika
Chaika•2mo ago
tunnel might not have routed it right but it did get that far at least hmm what exactly did the debug info show?
tobi
tobiOP•2mo ago
this is not valid anymore, but something like this (from an hour ago):
2024-10-04T13:37:02Z DBG GET https://mounts-bracket-du-noon.trycloudflare.com/ HTTP/1.1 connIndex=0 content-length=0 event=1 headers={"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Accept-Encoding":["gzip"],"Accept-Language":["en-GB,en-US;q=0.9,en;q=0.8,de;q=0.7"],"Cdn-Loop":["cloudflare; loops=1; subreqs=1"],"Cf-Connecting-Ip":["2001:4bb8:2a7:df59:ec3f:a5e9:2319:a8bb"],"Cf-Ew-Via":["15"],"Cf-Ipcountry":["AT"],"Cf-Ray":["8cd5907714ec5b0f-VIE"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Cf-Warp-Tag-Id":["f54cd74e-f59a-423b-ab46-88e6901221e0"],"Cf-Worker":["trycloudflare.com"],"Priority":["u=0, i"],"Sec-Ch-Ua":["\"Chromium\";v=\"128\", \"Not;A=Brand\";v=\"24\", \"Google Chrome\";v=\"128\""],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Ch-Ua-Platform":["\"macOS\""],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"],"X-Forwarded-For":["2001:4bb8:2a7:df59:ec3f:a5e9:2319:a8bb"],"X-Forwarded-Proto":["https"]} host=mounts-bracket-du-noon.trycloudflare.com ingressRule=1 originService=http_status:404 path=/
2024-10-04T13:37:02Z DBG 404 Not Found connIndex=0 content-length=0 event=1 ingressRule=1 originService=http_status:404
2024-10-04T13:37:02Z DBG GET https://mounts-bracket-du-noon.trycloudflare.com/ HTTP/1.1 connIndex=0 content-length=0 event=1 headers={"Accept":["text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"],"Accept-Encoding":["gzip"],"Accept-Language":["en-GB,en-US;q=0.9,en;q=0.8,de;q=0.7"],"Cdn-Loop":["cloudflare; loops=1; subreqs=1"],"Cf-Connecting-Ip":["2001:4bb8:2a7:df59:ec3f:a5e9:2319:a8bb"],"Cf-Ew-Via":["15"],"Cf-Ipcountry":["AT"],"Cf-Ray":["8cd5907714ec5b0f-VIE"],"Cf-Visitor":["{\"scheme\":\"https\"}"],"Cf-Warp-Tag-Id":["f54cd74e-f59a-423b-ab46-88e6901221e0"],"Cf-Worker":["trycloudflare.com"],"Priority":["u=0, i"],"Sec-Ch-Ua":["\"Chromium\";v=\"128\", \"Not;A=Brand\";v=\"24\", \"Google Chrome\";v=\"128\""],"Sec-Ch-Ua-Mobile":["?0"],"Sec-Ch-Ua-Platform":["\"macOS\""],"Sec-Fetch-Dest":["document"],"Sec-Fetch-Mode":["navigate"],"Sec-Fetch-Site":["none"],"Sec-Fetch-User":["?1"],"Upgrade-Insecure-Requests":["1"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36"],"X-Forwarded-For":["2001:4bb8:2a7:df59:ec3f:a5e9:2319:a8bb"],"X-Forwarded-Proto":["https"]} host=mounts-bracket-du-noon.trycloudflare.com ingressRule=1 originService=http_status:404 path=/
2024-10-04T13:37:02Z DBG 404 Not Found connIndex=0 content-length=0 event=1 ingressRule=1 originService=http_status:404
Chaika
Chaika•2mo ago
ingressRule=1 originService=http_status:404 path=/
it didn't match any ingress rule/use your --url
tobi
tobiOP•2mo ago
what does it mean? cloudflared tunnel --url http://localhost:8000 this is how i started the tunnel
Chaika
Chaika•2mo ago
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 option
tobi
tobiOP•2mo ago
i updated it in hopes for that issue to be fixed, like an hour ago version 2024.9.1
Chaika
Chaika•2mo ago
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]
tobi
tobiOP•2mo ago
ahh that might be, could be years ago ^^ is there something like '--ignoreconfig'
MDev
MDev•2mo ago
😄
Chaika
Chaika•2mo ago
no but you could just..delete it. On startup it should tell you if it can find a config or not
tobi
tobiOP•2mo ago
hmm i dont see that it uses any config, a search i didn't find any config files (config.yaml)
Chaika
Chaika•2mo ago
What's the full output of the startup?
tobi
tobiOP•2mo ago
2024-10-04T15:35:09Z INF Requesting new quick Tunnel on trycloudflare.com...
2024-10-04T15:35:15Z INF +--------------------------------------------------------------------------------------------+
2024-10-04T15:35:15Z INF | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
2024-10-04T15:35:15Z INF | https://estate-quilt-cfr-forces.trycloudflare.com |
2024-10-04T15:35:15Z INF +--------------------------------------------------------------------------------------------+
2024-10-04T15:35:15Z INF Version 2024.9.1
2024-10-04T15:35:15Z INF GOOS: darwin, GOVersion: go1.22.2-devel-cf, GoArch: amd64
2024-10-04T15:35:15Z INF Settings: map[cred-file:/Users/tobi/.cloudflared/bcbfdd4a-fbd5-4a0c-9abb-eff5b9eab19d.json credentials-file:/Users/tobi/.cloudflared/bcbfdd4a-fbd5-4a0c-9abb-eff5b9eab19d.json ha-connections:1 protocol:quic url:http://localhost:8000]
2024-10-04T15:35:15Z INF cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/as-a-service/
2024-10-04T15:35:15Z INF Generated Connector ID: 57c1b898-e3d5-4b79-b653-46f020b728df
2024-10-04T15:35:15Z INF Initial protocol quic
2024-10-04T15:35:15Z INF ICMP proxy will use 192.168.8.118 as source for IPv4
2024-10-04T15:35:15Z INF ICMP proxy will use 2001:4bb8:2a7:df59:a26a:5f0:1988:3 in zone en0 as source for IPv6
2024-10-04T15:35:15Z INF Created ICMP proxy listening on 192.168.8.118:0
2024-10-04T15:35:15Z INF Starting metrics server on 127.0.0.1:50392/metrics
2024-10-04T15:35:09Z INF Requesting new quick Tunnel on trycloudflare.com...
2024-10-04T15:35:15Z INF +--------------------------------------------------------------------------------------------+
2024-10-04T15:35:15Z INF | Your quick Tunnel has been created! Visit it at (it may take some time to be reachable): |
2024-10-04T15:35:15Z INF | https://estate-quilt-cfr-forces.trycloudflare.com |
2024-10-04T15:35:15Z INF +--------------------------------------------------------------------------------------------+
2024-10-04T15:35:15Z INF Version 2024.9.1
2024-10-04T15:35:15Z INF GOOS: darwin, GOVersion: go1.22.2-devel-cf, GoArch: amd64
2024-10-04T15:35:15Z INF Settings: map[cred-file:/Users/tobi/.cloudflared/bcbfdd4a-fbd5-4a0c-9abb-eff5b9eab19d.json credentials-file:/Users/tobi/.cloudflared/bcbfdd4a-fbd5-4a0c-9abb-eff5b9eab19d.json ha-connections:1 protocol:quic url:http://localhost:8000]
2024-10-04T15:35:15Z INF cloudflared will not automatically update when run from the shell. To enable auto-updates, run cloudflared as a service: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/run-tunnel/as-a-service/
2024-10-04T15:35:15Z INF Generated Connector ID: 57c1b898-e3d5-4b79-b653-46f020b728df
2024-10-04T15:35:15Z INF Initial protocol quic
2024-10-04T15:35:15Z INF ICMP proxy will use 192.168.8.118 as source for IPv4
2024-10-04T15:35:15Z INF ICMP proxy will use 2001:4bb8:2a7:df59:a26a:5f0:1988:3 in zone en0 as source for IPv6
2024-10-04T15:35:15Z INF Created ICMP proxy listening on 192.168.8.118:0
2024-10-04T15:35:15Z INF Starting metrics server on 127.0.0.1:50392/metrics
Chaika
Chaika•2mo ago
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]
tobi
tobiOP•2mo ago
ahhh ok thanks, so i need to find it
Chaika
Chaika•2mo ago
probably under /Users/tobi/.cloudflared/? maybe debug level shows
tobi
tobiOP•2mo ago
ahahhhh thank you very much 🙂 yes that was it, thanks 🙂
Chaika
Chaika•2mo ago
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
tobi
tobiOP•2mo ago
yeah :/ i completely disregarded the warning about config in the docs because i thought i overrode with quick tunnel anyways
Want results from more Discord servers?
Add your server