Search code examples
azureazure-web-app-serviceazure-appservice

How to route requests between ports based on sub-domains?


I am using Azure App Service and looking for a way to achieve my goal like the picture attached below. One single app service with multiple sites, each site listening on a different port, and then routing clients' requests to a particular port based on domain name. enter image description here

The first idea came into my mind was IIS or Nignx, but haven't found out how to install and configure that in the app service.

I am not sure if this architecture is possible or not by using the Azure app service, based on what I've searched is that it is possible to do a path mapping using virtual applications & directories feature.

https://corey.com/miracles
https://corey.com/scientist
https://corey.com/yellow

That solution also works for me but it affects SEO settings so it's not the perfect one.


Solution

  • Thanks @Vinicius Deschamps for the comments.

    • Virtual Application is one of the best options for Azure App Services hosted on Windows Environment.

    Refer this SO Thread which I have answered to work with Virtual Applications.

    • AFAIK,you cannot directly install the IIS or Nginx in the Azure App Service.

    ASE are accessible only from virtual machines (VMs)

    • Nginx.com explains how to use Nginx for an Azure App Service.

    • Another option available is to use the Application Gateway.

    • Application gateway acts like a load balancer and enables you to manage your applications.

    enter image description here