IISExpress从远程计算机返回503错误

我试图测试我的本地网络上运行的本地IISExpress实例中的一些网站上的一些其他机器/设备。 我正在运行Win7 Pro。

当我第一次尝试从本地网段上的另一台计算机浏览我的计算机时,出现400错误:主机名无效。

我知道我需要使用提升命令提示符下的命令来授予对ACL的远程访问权限,如:

netsh http add urlacl url=http://mymachinename:50333/ user=everyone

现在我得到一个503服务不可用的错误。

Windows防火墙目前已关闭,我可以使用地址http://localhost:50333 50333浏览我的本地IISExpress实例

这个配置难题的最后一块是什么?


它看起来像在applicationhost.config文件中缺少绑定信息条目。

  • 打开你的applicationhost.config文件。 可能的位置是:

  • %userprofile%DocumentsIISExpressconfigapplicationhost.config
  • $(solutionDir).vsconfigapplicationhost.config (VS2015)
  • 如果没有,请检查iisexpress.exe的输出iisexpress.exe
  • 找到您的WebSite条目并添加以下与您的机器名称绑定。

         <binding protocol="http" bindingInformation=":50333:your-machine-name" />
    
  • 重新启动IIS Express


  • 只有一件事对我有用。

    使用*:portnumber:*是不好的。 是的,在这样做并确保Windows防火墙已打开后,我可以连接到端口,但我仍然收到“503”错误。

    我在本地测试了一些东西,发现只有http:// localhost工作。 使用真实IP地址(不是127.0.0.1,但是例如192.168.1.50),即使在本地机器上仍然返回503。 我尝试使用绑定中的真实主机名,但IIS Express拒绝启动。 这实际上可能与主机名称的解析方式有关。 我没有进一步探索。

    最后,我结束了使用这个配置:

    <binding protocol="http" bindingInformation="*:53351:localhost" />
    <binding protocol="http" bindingInformation="192.168.1.50:53351:*" />
    

    通过这种方式,我可以使用http://192.168.1.50:53351从远程机器进行连接。


    在这样一个完整的主题上浪费了3个多小时后,我决定与你分享我的设置。 我的配置是在Windows 8上的Web更新4的Visual Express 2012。这是我第一次回到MS VS自研究(至少8年),现在我确信Linux的规则。 在Django上,这种设置让我花费了10分钟的搜索文档。

  • 关闭防火墙进行测试

    netsh advfirewall set allprofiles state off
    
  • 安装绑定在我的情况下本地地址是本地IP = 192.168.1.102(因为链接不能包含非数值域,使用它下面而不是mylocaldomain.com,请参阅stackoverflow策略)在DocumentsIISExpressconfigapplicationhost.config

    <bindings>
        <binding protocol="http" bindingInformation="*:53351:mylocaldomain.com" />
        <binding protocol="http" bindingInformation="*:53351:localhost" />
    </bindings>
    
  • 自动添加自动运行ISS Express启动服务

    <site name="NeuronCharts" id="2" serverAutoStart="true">
    
  • 向http服务器添加一些奇怪的规则(我仍然不知道这是否是nesseary)

    netsh http add urlacl url=http://mylocaldomain.com:53351/ user=everyone
    
  • 不要从VS IDE手动运行IISExpress

  • 你会看到ISSExpress正在注册绑定
  • 运行浏览器http://mylocaldomain.com:53351如果它正在工作,那么我们可以添加防火墙规则
  • 添加防火墙规则

    netsh advfirewall firewall add rule name="IISExpressWeb" dir=in protocol=tcp localport=53351 remoteip=any action=allow
    
  • 如果要访问本地网络使用localsubnet,请将remoteip设置为任意位置,以便从外部访问您的服务器

  • 启动防火墙

    netsh advfirewall set allprofiles state on
    
  • 再次检查一切是否在本地和公共IP上工作

  • 祝你好运

    拉法尔

    链接地址: http://www.djcxy.com/p/68721.html

    上一篇: IISExpress returns a 503 error from remote machines

    下一篇: ServiceStack request POST body as query string