How to implement different sub domain for different web roles hosted in a single cloud service

38 views Asked by At

We have created an Azure cloud service which has a presentation layer web role and and an API layer web role.We have mobile clients accessing the API layer and hence designed to be scalable by each layer.

As both web roles are hosted in a single cloud service currently we are accessing both roles using port numbers. that is https://xyz.cloudapp.net:44300/ and https://xyz.cloudapp.net:44301/.

We have purchased custom domain and is currently pointing the CNAME to https://xyz.cloudapp.net and it accesses https://xyz.cloudapp.net:44300/.

Lets assume our custom domain name is example.com .Now we would like to access the main site by https://www.example.com and API by https://api.example.com rather than going by ports.

As per my investigation I have found that this is not possible using host header as the Azure load balancer does not examine host header at the network layer it operates. So option is write a URL redirect at the default site.

Do we have a better way to achieve this?

0

There are 0 answers