简体   繁体   English

将https更改为其他端口IIS Express applicationhost.config

[英]Change https to different port IIS Express applicationhost.config

I start two websites in a sln of mine. 我在我的sln中建立了两个网站。 Because the https port 44300 is used for both websites, the startup of the second website fails with IISExpress error. 因为两个网站都使用https端口44300,所以第二个网站的启动失败,并出现IISExpress错误。

If I change the HTTPS port in the applicationhost.config for one of the sites it just gets reverted back to 44300. I deleted the https binding entries, they just get added back. 如果我更改了其中一个站点的applicationhost.config中的HTTPS端口,它将被还原回44300。我删除了https绑定条目,它们刚刚被添加回去。

      <site name="prj(1)" id="130">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="PATH" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:53884:localhost" />
                    <binding protocol="https" bindingInformation="*:44300:localhost" />
                </bindings>
            </site>
       <site name="prj2" id="102">
                <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="PATH" />
                </application>
                <bindings>
                    <binding protocol="http" bindingInformation="*:54777:localhost" />
                    <binding protocol="https" bindingInformation="*:44300:localhost" />
                </bindings>
            </site>

I found the answer in this thread on SO: IIS Express defaulting to port 44300 for https when enabling SSL 我在SO上的该线程中找到了答案: 启用S​​SL时,IIS Express默认将https的端口号设置为44300

The binding: 绑定:

 <binding protocol="https" bindingInformation="*:44300:localhost" />

will always get added to the IIS Express applicationhost.config sooner or later, no matter how many times you try to remove it. 不管您尝试删除多少次,它总是会迟早添加到IIS Express applicationhost.config中。

From my link though, there is mention of "the port 44300 is sequential: 00 mean that its the first application you have configured as SSL enabled; 01 will be the second one and so on." 但是,从我的链接中可以提到“端口44300是顺序的:00表示它是配置为启用SSL的第一个应用程序; 01是第二个,以此类推。”

So I just changed my bindings to F5 multiple websites, using IIS Express at the same time to: 因此,我只是使用IIS Express同时将对F5多个网站的绑定更改为:

Website1: 网站1:

Website2: 网站2:

<binding protocol="https" bindingInformation="*:44301:localhost" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM