How to host multiple .NET Core apps under same url

后端 未结 6 760
南旧
南旧 2020-12-31 07:21

I am building a few web sites in asp.net core (multiple user interface applications and a web api app). They all work together, utilising the web api. For the purpose of m

6条回答
  •  悲&欢浪女
    2020-12-31 07:38

    You don't need to create a site for each app, you can host it as before, as web applications inside one site. The only thing you need to do is select unmanaged app pool for your .Net Core applications, that's it. So this works: https://domain/app1 and https://domain/app2 and you only need 1 certificate for a web server

    Alternatively, you can create site for each app, then you need a sub-domain for each app, like https://app1.domain and like https://app2.domain In this case all sub-domains must point to the same IP (if your server only have one) and you need to set up bindings for each site\app to it's domain. You should bind all sites to the same port (443 or 80).

    For SSL in multiple sites configuration if you have IIS 7 you need to have a wildcard certificate. In IIS 8 and above you can use Server name indication feature and have a separate certificate for each site, however I recommend you to use wildcard certificate as well since SNI is new and might not be supported by some browsers

    In both cases you need to set up a Windows Server Hosting from here Microsoft's download center

提交回复
热议问题