why i get this error
im using cloudflare workers to point my subdomain to ip:port
but if i opened the site through ip:port it works
7 Replies
What are you trying to do with Cloudflare Workers? You should probably be using Origin Rules, which can override the dest. port easily. Workers cannot fetch IPs, only domains
and in my domain i add cname record "api" with content "xxxxxx.xxxxxx.workers.dev"
There are a few things wrong with that, request.url is the full url including the scheme/hostname, and "port" isn't valid, not sure if you redacted that, looks like something chatgpt would produce (just a guess, or did you get that from a modified example or something?). Configure SSL on your origin (can use origin ca cert CF gives for free), and then use a simple Origin Rule like this
I added the Rule
You'll have to remove the worker route (they run in front of normal requests), and replace the API DNS Record with one pointing at your actual origin's IP (A/AAAA record), proxied
@chaika.me THANKS SO MUCH
I've been trying all day to do this
no problem , you were making harder on yourself then it needed to be by using a worker