0

我试图得到它,以便任何请求:

http://<myserver>:1234

被重定向到:

https://<myserver>:1234

我尝试在模块中使用“this.RequiresHttps()”,但是当我点击 urlhttp://<myserver>:1234时,浏览器只是旋转,我猜这是因为我没有NancyHost使用 HTTP URI 构建。我无法将 HTTP URI 与 HTTPS URI 一起添加到 NancyHost,如下所示:

var host = new NancyHost(new Uri("http://localhost:1234"), new Uri("https://localhost:1234"));

因为我会遇到注册冲突。

有任何想法吗?

4

1 回答 1

5

你不能让 http 和 https 在同一个端口上监听。更改 https 绑定的端口,并在 RequiresHttps 调用中指定它。

于 2013-07-17T17:51:36.510 回答