[英]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.