【问题标题】:WebAPI self-host 503 error (HttpSelfHostConfiguration setted HttpSelfHostConfiguration)WebAPI 自托管 503 错误(HttpSelfHostConfiguration 设置了 HttpSelfHostConfiguration)
【发布时间】:2014-02-03 11:15:33
【问题描述】:

我有一个使用自托管 WebAPI 的窗口服务。 HttpSelfHostConfiguration.HostNameComparisonMode 设置 HostNameComparisonMode.Exact 用于主机名强匹配。

var config = new HttpSelfHostConfiguration(uri);
config.HttpSelfHostConfiguration = System.ServiceModel.HostNameComparisonMode.Exact;
this._server = new HttpSelfHostServer(config);
_server.OpenAsync().Wait();

并为域的指定 URL 命名空间保留 URL。

netsh http add urlacl url=https://+:443/ user=EVERYONE

将 SSL 证书绑定到端口号。

netsh http add sslcert ipport=0.0.0.0:443 certhash=xxxxxxxxxxx appid={xxxxxxxxx}

但结果出现 HTTP 503 错误。 我不知道状态。

【问题讨论】:

  • 您在哪个帐户下运行服务?
  • 帐户是本地系统。

标签: c# asp.net-web-api


【解决方案1】:

我遇到了类似的问题。我的问题是我的 URL 重复 urlacl。

netsh http show urlacl
...
http://+:80/api 
http://127.0.0.1:80/api (or any IP)

为您的程序删除所有可能重复的 urlacl。

【讨论】:

  • 难以置信。我很想知道它为什么会这样。
猜你喜欢
  • 1970-01-01
  • 2020-08-03
  • 2016-10-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多