I have a site in Azure. Pages are generated by Azure Functions, but for a given URL generated page will always be identical, so I put it behind a CDN endpoint. I added custom domains to the endpoint: www.example.com
is the main domain and there is also a naked domain version example.com
, but any request to it is redirected to the www.example.com
. Any http
requests are also redirected to https
. Both redirects are performed by returning redirect result from Azure Function.
So, both http://example.com
and http://www.example.com
properly redirected to https://www.example.com
. The problem arises if someone tries to access https://example.com
. The certificate served for this url is *.azureedge.net
and the browser predictably displays a warning message (if instructed to proceed - it receives a redirect and works fine after that).
When I try to enable Custom HTTPS
on example.com
- I get an error Enabling Https with CDN Managed Certificate is not supported anymore for apex (root) domains.
Is there any way I can fix this, perhaps instruct a redirect from example.com
to www.example.com
on DNS level? I've seen suggestions to use alternative CDNs available in Azure, but I'm not ready to go down that route yet.