简体   繁体   English

503服务不可用IIS +本地主机+ WebAPI + VS Android仿真器.Net Core 2

[英]503 service unavailable IIS + localhost + WebAPI + VS Android Emulator .Net Core 2

I don't have any other idea. 我没有其他想法

I have WebAPI (.NetCore 2) running on my localhost on IIS. 我在IIS的本地主机上运行了WebAPI(.NetCore 2)。 When I connect to it using Postman, everything works fine. 当我使用Postman连接到它时,一切正常。 But when I try to connect from VS Android Emulator I am getting only 503 errors. 但是,当我尝试从VS Android仿真器进行连接时,仅收到503错误。 I think I tried everything. 我想我尝试了一切。

My settings are: - WebApi is running on port 8080 我的设置是:-WebApi在端口8080上运行

应用程序设置

My VS Emulator networks settings are: 我的VS Emulator网络设置为: 模拟器网络设置

I am connecting to WebApi using: http://169.254.80.80:8080/api/ 我正在使用http://169.254.80.80:8080/api/连接到WebApi

On localhost (for example from Postman) is: http://localhost:8080/api/ 在localhost(例如来自Postman)上是: http:// localhost:8080 / api /

I have added Incoming Rule to my windows defender allowing connections for TCP port 8080. 我在Windows防御程序中添加了传入规则,以允许连接TCP端口8080。

This is my SITES section from applicationhost. 这是来自applicationhost的SITES部分。

<sites>
  <site name="WebSite1" id="1" serverAutoStart="true">
    <application path="/">
      <virtualDirectory path="/" physicalPath="%IIS_SITES_HOME%\WebSite1" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation=":8080:localhost" />
    </bindings>
  </site>
  <site name="Nerdolando.Boomerang.WebAPI" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="D:\projekty\cs\Boomerang\source\webapi\Nerdolando.Boomerang.WebAPI" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:50628:localhost" />
      <binding protocol="http" bindingInformation="*:50628:169.254.80.80" />
      <binding protocol="http" bindingInformation="169.254.80.80:8080" />
      <binding protocol="http" bindingInformation="*:8080:169.254.80.80" />
    </bindings>
  </site>
  <siteDefaults>
    <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
    <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
  </siteDefaults>
  <applicationDefaults applicationPool="Clr4IntegratedAppPool" />
  <virtualDirectoryDefaults allowSubDirConfig="true" />
</sites>

As you can see, I tried different bindings. 如您所见,我尝试了不同的绑定。 And still getting 503 error. 仍然出现503错误。 What can I do more? 我还能做些什么?

Your IIS binding is wrong: http:*:8080:localhost 您的IIS绑定错误: http:*:8080:localhost

You have "localhost" in the 'Host name' field. 您在“主机名”字段中有“ localhost”。 That means that IIS will only send traffic to that site if "localhost" is used as the domain name. 这意味着,如果将“ localhost”用作域名,则IIS仅将流量发送到该站点。 Since you are trying to access by IP, IIS doesn't know which site to send it to and gives you a 503. 由于您尝试通过IP访问,因此IIS不知道将其发送到哪个站点,并为您提供503。

Your binding should look like this (leave the 'Host name' blank): 您的绑定应如下所示(将“主机名”留空):

在此处输入图片说明

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

相关问题 在IIS中托管(503服务不可用) - Hosting in IIS (503 Service Unavailable) 发布到 IIS 后 .Net 核心服务不可用 - .Net core Service Unavailable after Publish to IIS Visual Studio IIS HTTP 503 服务不可用 - Visual Studio IIS HTTP 503 Service Unavailable HTTP 错误 503。该服务在 IIS 中不可用? - HTTP Error 503. The service is unavailable in IIS? IIS 停止并出现错误消息“HTTP 错误 503。服务不可用” - IIS stopped and error message "HTTP Error 503. The service is unavailable" HTTP 503:服务不可用 - HTTP 503 : Service Unavailable .Net HttpListener.GetContext()为客户端提供“503 Service Unavailable” - .Net HttpListener.GetContext() gives “503 Service Unavailable” to the client 在IIS上配置.net核心Web应用程序和webapi - Configuration .net core web application and webapi on IIS 使用 ApplicationPoolIdentity 或自定义帐户时,IIS8“HTTP 错误 503 - 服务不可用”,但在使用 NetworkService 时则不然 - IIS8 'HTTP Error 503 - Service unavailable' when using ApplicationPoolIdentity or a custom account, but not when using NetworkService IIS服务器上的Web API内的Httpclient GetAsync失败(503 Service Unavailable) - Httpclient GetAsync Fails(503 Service Unavailable) inside Web API on IIS Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM