I have set up a Cloudflare Worker to trigger on a custom subdomain. It works if the subdomain is just one level deep, i.e. api.mydomain.com, but not if it’s two levels deep, i.e. api.dev.mydomain.com.
I have purchased an ACM that covers the subdomain but the worker still doesn’t run. I also don’t get an error, it just gets bypassed. I have spent hours looking in the community and docs, but found no resolution. I have contacted Cloudflare support and just got a response to make sure the orange cloud is turned on (it is) and after that radio silence for a week
Is the Worker mapped to
*.dev.example.com? I don’t believe just being mapped to
*.example.com will cover all levels.
I do notice something odd - if I open the api.dev.mydomain subdomain in a browser, the certificate displayed is the one on the server, while the api.mydomain displays the Cloudflare ACM certificate. It’s like api.dev.mydomain isn’t proxied, but the cloud icon is orange. Could the issue be something else?
I have also disabled Universal SSL once I got the ACM, if that is any type of clue.
Have you verified the SSL certificate used using a 3rd party rather than your web browser? Check using SSL Server Test (Powered by Qualys SSL Labs) to see which SSL certificate is served.
I just did and the third party does actually show the Cloudflare certificate on the subdomain. Odd. So back to why the worker doesn’t kick in
It started working after turning the orange cloud off and on a few times - I tried the same thing before and it didn’t help but this time it did.
Could of been local browser caching at play. Hence why I suggested 3rd party checking