-1

I own for a website (example.com (GoDaddy)) and I set the name servers to Azure and manage DNS from there. I don't know enough about DNS to know how to properly do what I'm trying to do or the pros/cons. I have SSL always set in my AppService.

I want www.example.com to forward to example.com (on both http and https). Currently, I have both registered and bound to a cert in the AppServices and it works over https. The following links work in fact.

http://example.azurewebsites.net forwards to -> https

https://example.azurewebsites.net works/secure (seems to be using *.azurewebsites.net cert)

http://example.com forwards to https://example.com

https://example.com works/secure using example.com cert

http://www.example.com (forwards to https)

https://www.example.com (works using example.com cert).

So, all of these work and are secure... but I'd like ALL of them to forward to the naked and secure: https://example.com

I setup (In Azure) www CNAME to point to example.azurewebsites.net. Can I get this to happen through dns configuration or do I need to modify the actual AppService code to detect www and forward?

Also, if later I want someOtherAPI.example.com (can it point to another totally different AppService and use the same cert or will it need another cert?

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • Hi, If you have any question, please let me know. – Nancy Jul 18 '19 at 02:11
  • yeah I never did figure this out... for now, my site seems to be ok with either www.mysite.com or just mysite.com ... they do act as separate domains though (like each having their own separate local Session Store. But... – Matthew Mackay Jul 19 '19 at 04:28

1 Answers1

0

It seems you want to know two points in your question:

  1. So, all of these work and are secure... but I'd like ALL of them to forward to the naked and secure: https://example.com

    By default, Azure provides a wildcard cert *.azurewebsites.net for the domain azurewebsites.net, so you could use https for the domain and its subdomain. If you want to forward all traffic forward to the URL https://example.com, you need to change your code like URL rewrite or URL redirect in the web.config file. View More details here1 and here2

  2. Also, if later I want someOtherAPI.example.com (can it point to another totally different AppService and use the same cert or will it need another cert?

    The SSL cert DNS name must match the domain name in the website URL. So if you want to secure the website for the domain someOtherAPI.example.com, you need an SSL cert DNS name as someOtherAPI.example.com or wildcard domain *.example.com for this website.

Hope this could help you.

Nancy
  • 26,865
  • 3
  • 18
  • 34