如何为每个用户创建我的 Web 应用程序的别名?
How to create an alias of my web application for each user?
我需要创建如下内容:http://username.mydomain.com。
我正在使用 ASP.NET,我的 Web 应用程序将托管在 IIS 服务器.
根据 this answer,我必须在 IIS 中添加一个名为 username.mydomain.com 的额外网站。这是否意味着如果我有 100 万用户,我必须创建 100 万个额外的网站?
我认为这不是最好的解决方案。
您不需要为每个额外的帐户创建一个单独的网站 - you just need a new HTTP Host header binding. You can do this either by creating a new binding for each additional subdomain, or use a "catchall" (default) binding that handles all requests for a given port binding. IIS 10.0 (Windows Server 2016) finally added support for "wildcard" host-headers so that's now the preferred option for this scenario: https://www.iis.net/learn/get-started/whats-new-in-iis-10/wildcard-host-header-support
我需要创建如下内容:http://username.mydomain.com。
我正在使用 ASP.NET,我的 Web 应用程序将托管在 IIS 服务器.
根据 this answer,我必须在 IIS 中添加一个名为 username.mydomain.com 的额外网站。这是否意味着如果我有 100 万用户,我必须创建 100 万个额外的网站?
我认为这不是最好的解决方案。
您不需要为每个额外的帐户创建一个单独的网站 - you just need a new HTTP Host header binding. You can do this either by creating a new binding for each additional subdomain, or use a "catchall" (default) binding that handles all requests for a given port binding. IIS 10.0 (Windows Server 2016) finally added support for "wildcard" host-headers so that's now the preferred option for this scenario: https://www.iis.net/learn/get-started/whats-new-in-iis-10/wildcard-host-header-support