Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with naked domains when using azure managed certificates

I'm trying to use the recently announced (in preview) managed certificates for Azure app service. One of the limitations is that you can't get one for naked domains. eg.: you can get one for www.domain.com, but not domain.com.

In my (current) web.config, I'm redirecting from 'naked' to 'www' anyway using rewrite rules, so beeing limited to 'www' is not a real problem. However, as the redirect takes place at the web.config level, that is, after the request has hit the webserver, this is too late: when 'domain.com' gets hit and tries to redirect, the browser has already seen the insecure connection to the naked domain (depending on browser) will display a warning page.

So how is one supposed to do deal with the "naked" domains? No more redirects at all? Or are there other methods to do this besides web.config configurations? I did look, but did not find anything.

like image 298
Thomas Woelfer Avatar asked Nov 13 '19 08:11

Thomas Woelfer


1 Answers

So, after a long time, Azure finally supports this. One can simply use a managed cert for naked domains.

See here: https://azure.github.io/AppService/2021/03/02/asmc-apex-domain.html

like image 141
Thomas Woelfer Avatar answered Oct 17 '22 22:10

Thomas Woelfer