【问题标题】:using custom port and domain name with IIS express通过 IIS express 使用自定义端口和域名
【发布时间】:2011-07-19 20:18:43
【问题描述】:

我有两个使用 asp.net MVC3 构建的 Web 应用程序。我想使用自定义域在本地运行它们,并且在 url 中没有任何端口号。无需担心远程访问等。这仅适用于本地开发环境

例如:

htp://app1.cc.com-->Application1

htp://app2.cc.com-->Application2

我需要类似 htp://app1.cc.com/questions/4709014/using-custom-domains-with-iis-express 的东西

目前我的网址是http://localhost:34752/questions/4709014/using-custom-domains-with-iis-express

我按照这个问题中的步骤操作:

Using Custom Domains With IIS Express

但这是使用保留端口 80,这很好,但 如何与两个应用程序共享此端口

【问题讨论】:

    标签: iis dns


    【解决方案1】:

    只需在 applicationhost.config 中添加绑定

    类似的东西

    <site name="site1" id="1" serverAutoStart="true">
    <bindings>
         <binding protocol="http" bindingInformation="*:80:app1.cc.com" />
    </bindings>
    </site>
    
    <site name="site2" id="2" serverAutoStart="true">
    <bindings>
         <binding protocol="http" bindingInformation="*:80:app2.cc.com" />
    </bindings>
    </site>
    

    【讨论】:

    • 我认为您不需要单独的站点。只需将第二个绑定添加到第一个站点中的绑定即可。这在我们的案例中有效。不过,感谢@Dan 的提示!
    猜你喜欢
    • 2011-06-10
    • 1970-01-01
    • 1970-01-01
    • 2013-11-20
    • 2016-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多